Solaris Zone host, bridged adapter mode cannot ping subnet

Discussions related to using VirtualBox on Solaris hosts.
Post Reply
philhar88
Posts: 3
Joined: 25. Feb 2011, 06:49
Primary OS: Solaris
VBox Version: PUEL
Guest OSses: ubuntu

Solaris Zone host, bridged adapter mode cannot ping subnet

Post by philhar88 »

Hi All,

I'm running VirtualBox 4.0.4 in an OpenIndiana 148 zone.

Code: Select all

OpenIndiana     SunOS 5.11      oi_148  November 2010
I've linked my devices from the global zone to my VirtualBox zone.

Code: Select all

zonecfg:vboxzone>add device
zonecfg:vboxzone:device>set match=/dev/vboxdrv
zonecfg:vboxzone:device>set match=/dev/vboxnet
zonecfg:vboxzone:device>set match=/dev/vboxnet0
zonecfg:vboxzone:device>set match=/dev/vboxusbmon
zonecfg:vboxzone:device>end
zonecfg:vboxzone>verify
zonecfg:vboxzone>exit
I can see the ethernet adapters in my zone:

Code: Select all

root@vbox:~# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000 
vboxnet0: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 2
        inet 192.168.56.1 netmask ffffff00 broadcast 192.168.56.255
        ether 8:0:27:ec:7e:fe 
vboxzone1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 192.168.1.3 netmask ffffff00 broadcast 192.168.1.255
        ether 2:8:20:8f:9e:25 
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
        inet6 ::1/128 
I can boot my Ubuntu 10.10 LiveCD just fine and connect to it using VRDP on port 3389.

The Guest OS gets a dhcp assigned ip address from my router and I can see the routes have been populated correctly:

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
However I cannot ping any hosts, including my router or the host machine.

Guest Additions is installed.

Any ideas?

Thanks
kebabbert
Volunteer
Posts: 321
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Re: Solaris Zone host, bridged adapter mode cannot ping subnet

Post by kebabbert »

Do you use bridge or NAT? Only one one bridged VM can be active, the rest of running VMs must be NAT.
philhar88
Posts: 3
Joined: 25. Feb 2011, 06:49
Primary OS: Solaris
VBox Version: PUEL
Guest OSses: ubuntu

Re: Solaris Zone host, bridged adapter mode cannot ping subnet

Post by philhar88 »

I have since worked this out.

You need to dedicate a VNIC to the guest OS to use in bridged mode.

Steps:

1. Create VNIC

Code: Select all

dladm create-vnic vnic1
2. Add VNIC to zone

Code: Select all

zonecfg -z zonename
add net
set physical=vnic1
end
commit
exit
3. Reboot zone

4. within zone show vnic

Code: Select all

dladm show-vnic
5. Note MAC address:

6. Set the bridged adapter MAC to above on the guest OS.
Last edited by philhar88 on 4. Jun 2011, 11:07, edited 1 time in total.
kebabbert
Volunteer
Posts: 321
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Re: Solaris Zone host, bridged adapter mode cannot ping subnet

Post by kebabbert »

Great recap! Thanx, can get handy when someone else googles on this question.

A question, is it correct what you have written? Once you say vnic0, and the other time vnic1. It should not be vnic0, twice?
philhar88
Posts: 3
Joined: 25. Feb 2011, 06:49
Primary OS: Solaris
VBox Version: PUEL
Guest OSses: ubuntu

Re: Solaris Zone host, bridged adapter mode cannot ping subnet

Post by philhar88 »

kebabbert wrote:Great recap! Thanx, can get handy when someone else googles on this question.

A question, is it correct what you have written? Once you say vnic0, and the other time vnic1. It should not be vnic0, twice?
thanks, it was a typo. corrected.
kebabbert
Volunteer
Posts: 321
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Re: Solaris Zone host, bridged adapter mode cannot ping subnet

Post by kebabbert »

You install VirtualBox in the global Solaris zone. Then you can create several zones, and startup VirtualBox in each zone. This allows you to cap cpu and RAM for each zone, that way a zone will not eat up all resources. If you do not run Virtualbox in zones, then you can not cap cpu/RAM (which can make one zone to eat all resources).

When you add a VNIC to a guest OS in virtualbox, you can set the "exclusive" property in zonecfg script. If you do not set this property, every zone must be NATed NIC. If you want to use bridged NIC in a zone, then you must set the "exclusive" property on that zone.
Ramshankar
Oracle Corporation
Posts: 793
Joined: 7. Jan 2008, 16:17

Re: Solaris Zone host, bridged adapter mode cannot ping subnet

Post by Ramshankar »

Have you tried capping the VM RAM from a zone? I'd be surprised if it works. The way we allocate memory for VMs is via the VirtualBox host drive which has no concept of zones. Other sundry memory via normal userland allocations would be capped but not the significant and meaningful portion of the memory.

As for capping CPU take a look VBoxManage's "cpuexecutioncap". That would works regardless of zones.
Oracle Corp.
Post Reply