Solaris虚拟机安装
有两种虚拟机:一是Vmware, 另一种是VirtualBox,
其中VirtualBox,可以从oralce网站下载Solaris已安装好的虚拟文件,再做导入即可。
当然两种虚拟机都支持使用ISO 镜像文件安装Solaris操作系统。
系统安装很简单,下面详细说一下网络配置:
在虚拟机中安装Solaris的过程中已经提示设置IP地址,子网隐码的了。但有的时候配置完成后还是不能上网。
1、在VM中设置网络使用桥接方式如下图:
2、设置了桥接之后,虚拟机里面的系统就可以使用与主机不同的IP地址连接互联网了。下面是具体的设置,针对系统为Solaris10,先看一下网卡,进入Solaris,后在最右下角点网络图标,如下图:
我们看到网络名称为e1000g0.
下面列出配置完成后各文件的内容:
# bash
bash-3.2# cd /etc
bash-3.2# cat ./hostname.e1000g0
solarisTest
bash-3.2# cat ./hosts
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
10.101.2.143 solarisTest loghost
bash-3.2# cat ./inet/netmasks
#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
# network-number netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
# 128.32.0.0 255.255.255.0
#
10.101.2.0 255.255.255.0
bash-3.2# cat ./defaultrouter
10.101.2.176
bash-3.2# cat ./resolv.conf
nameserver 202.96.134.133
bash-3.2# cat ./nsswitch.conf
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)nsswitch.files 1.14 06/05/03 SMI"
#
# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
passwd: files
group: files
hosts: files dns
ipnodes: files
networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files
# At present there isn't a 'files' backend for netgroup; the system will
# figure it out pretty quickly, and won't use netgroups at all.
netgroup: files
automount: files
aliases: files
services: files
printers: user files
auth_attr: files
prof_attr: files
project: files
tnrhtp: files
tnrhdb: files
bash-3.2#
以上需要注意的地方:
etc目录要创建文件defaultrouter文件来配置默认网关
10.101.2.176
etc目录要创建文件resolv.conf文件来配置dns地址
nameserver 202.96.134.133
完成以上两个配置之后,发现局域网能ping通,但还是不能上网,这时使用浏览器访问:
直接访问外网的IP是没问题的,但访问像www.163.com不行。使用nslookup命令
bash-3.2# nslookup
> baidu.com
Server: 202.96.134.133
Address: 202.96.134.133#53
Non-authoritative answer:
Name: baidu.com
Address: 220.181.111.86
Name: baidu.com
Address: 123.125.114.144
Name: baidu.com
Address: 220.181.111.85
发现域名解析是正常的。
最后发现要修改etc目录的配置文件
nsswitch.conf
将hosts一行最后面添加dns如修改完之后的为: hosts: files dns
修改完之后reboot重启,再进去可以上网了。
相关配置可参见:http://wenku.baidu.com/view/f51b351afc4ffe473368ab73.html
nslookup命令参见:http://wenku.baidu.com/view/f93a733a87c24028915fc3c5.html