How to configure internet access in Oracle Solaris 10 installed in a virtual box

5.3k views Asked by At

I have installed solaris 10 in virtual box 4.1.2. The installation was successful but it is not accessing internet.I have tried to create a bridged network which is a similar thing I did to Debian Installation and worked but it's still not working in the solaris. Please can anybody help solve this problem?

3

There are 3 answers

0
jlliagre On

If you leave the default VirtualBox network configuration (NAT) and if you configure Solaris to use DHCP, you should be able to access the Internet as long as the host OS is already connected to it.

0
Colinux On

In Vb set your nic to bridged.

In Solaris:

  1. Set a fixed ip.
  2. Set your default gateway.
  3. Set /etc/resolv.conf to your nameserver
  4. Set /etc/nsswitch.conf to files dns
  5. Check by pinging a "web-site"
  6. Also check with nslookup

This should all work fine.

2
Rajind Ruparathna On

I know this is a very old question but just posting for reference of others here. I wrote this blog post on configuring networking for Solaris 11 in VirtualBox.

We will go through configuring NAT, HostOnly and Bridged Adaptors. First we have to go to Setting for the Solaris VM in VirtualBox and from there to the Network Tab. Even though eventually we will add three network adaptors, I suggest we start by enabling only one adaptor as it might be hard to figure out which is which inside Solaris one we enable several network adaptors at once and try to configure them inside Solaris.

Configuring Bridge Adaptor

So to start with let’s turn on BridgedAdaptor. Make sure you press OK and save the changes. Now start up the VM and log-in.

enter image description here

Solaris 11 has this concept of “Network Configuration Profiles (ncp)”. There is

  1. Automatic – Uses DHCP to obtain network configuration (IP address, router and DNS) from any of the connected ethernet interfaces. Do not support hot swapping of interfaces and IPMP.

  2. Manual (DefaultFixed NCP) – interfaces needs to be manually configured using dladm and ipadm commands. Also called as DefaultFixed NCP. Supports hot swapping of interfaces and IPMP.

We want to use Manual profile. You can get a list of these by “netadm list” (network administration) command.

enter image description here

In the about output we can see “Automatic” is disabled and “DefaultFixed” is online. This is because I have already enabled it when installing Solaris. So if you don’t have DefaultFixed online run following commands.

netadm disable -p ncp Automatic
netadm enable -p ncp DefaultFixed

Now let’s run “dladm” (data link administration) command. You will see something similar to following.

enter image description here

Now we have to create IP configuration and for that we use “ipadm” (IP administration) command.

ipadm create-ip net0

Here net0 is the name I have given for IP configuration. You can use the LINK name you got as the output of “dladm” command.

To configure the configuration we created. Following command can be used.

ipadm create-addr -T static -a local=192.168.1.190/24 net0/v4

-T specifies either static, dhcp or addrconf (for IPv6) types of addresses. -a specifies address v4 is used to denote IP v4 but it can be any random string used to identify the interface.

Note that as we are configuring BridgedAdaptor we need a public IP for this interface and we are making it static.

To view the configurations following command can be used.

ipadm show-addr

That is about it for BridgeAdaptor configuration.

Configuring Route

Now we have to configure routes. To view routes run “route -p -n show”. To add default route,

route -p add default 192.168.1.1

If you want to delete a mistakenly added route you can use a command like

route -p delete default 192.168.1.100

Now you must be able to ping to this VM within the network.

Configuring HostOnly Adaptor

Configuring HostOnly Adaptor is similar to configuring BridgeAdaptor. You have to enable that from the VirtualBox setting first and then inside the VM you will be able to identify the newly added data link by “dladm” command. So you can configure that. Only difference would be that you will have to use an IP in 192.168.56.xxx range as it is the default range for VirtualBox host only IPs.

Configuring NAT

Configuring NAT has a slight difference. That is for NAT we will be using dhcp and not static. So command for configuring IP address is different.

ip-adm create-addr -T dhcp net2/v4

Configuring DNS

Adding DNS name server

rajind@solaris:~# svccfg -s dns/client
svc:/network/dns/client> setprop config/nameserver = (8.8.8.8 8.8.4.4)
svc:/network/dns/client> listprop config
config                      application
config/value_authorization astring     solaris.smf.value.name-service.dns.client
config/nameserver          net_address 8.8.8.8 8.8.4.4
svc:/network/dns/client> exit
rajind@solaris:~#


rajind@solaris:~# svcadm refresh dns/client
rajind@solaris:~# svcadm restart dns/client

Setting name service switch

rajind@solaris:~# svccfg -s name-service/switch
svc:/system/name-service/switch> setprop config/host = "files dns"
svc:/system/name-service/switch> listprop config
config                      application
config/default             astring     files
config/value_authorization astring     solaris.smf.value.name-service.switch
config/printer             astring     "user files"
config/host                astring     "files dns"
svc:/system/name-service/switch> exit
rajind@solaris:~#

rajind@solaris:~# svcadm refresh name-service/switch
rajind@solaris:~# svcadm restart name-service/switch

Many thanks to the authors of these blog posts.

http://thegeekdiary.com/how-to-configure-an-ip-address-in-solaris-11/

http://thegeekdiary.com/installing-oracle-solaris-11-in-virtualbox/

https://w3hol.wordpress.com/2011/12/29/setting-static-ip-address-on-solaris-11/