How to get Solaris 11 VNICs in a Virtualbox VM to work - kind of ...

Normally you can’t use a Solaris 11 VNIC on a virtualised interface in Virtualbox. It simply doesn’t work. “Virtualized on virtualized” doesn’t work well and as far as i understand it, the problem is that the hypervisor has no knowledge of the MAC addresses used by the VNICs. However it turned out this is not entirely true.
A warning: This isn’t something you should use on a regular schedule. When reading this blog entry, it will be obvious to you. I just want to set the expectations straight. It may break other stuff. However this trick is really useful, when you want to try out for example the highly-available configuration of the Solaris Integrated Loadbalancer by combining VRRP and ILB. This configuration uses a VRRP typed VNIC. I’ve used this trick last week in order to demonstrate exactly this HA-ILB configuration. Okay, let’s start with a plain standard system. One interface. It’s a “bridged networking” interface at the moment from Virtualbox perspective. There is an setting you have to do as well in the networking part: Set promiscuous mode to “Allow all”:


Now log into the system:

jmoekamp@solaris:~$ dladm 
LINK                CLASS     MTU    STATE    OVER
net0                phys      1500   up       --
jmoekamp@solaris:~$ ipadm
NAME              CLASS/TYPE STATE        UNDER      ADDR
lo0               loopback   ok           --         --
   lo0/v4         static     ok           --         127.0.0.1/8
   lo0/v6         static     ok           --         ::1/128
net0              ip         ok           --         --
   net0/v4        dhcp       ok           --         192.168.1.128/24

Okay. Pinging works.

client$ ping 192.168.1.128
PING 192.168.1.128 (192.168.1.128): 56 data bytes
64 bytes from 192.168.1.128: icmp_seq=0 ttl=255 time=0.271 ms
64 bytes from 192.168.1.128: icmp_seq=1 ttl=255 time=0.269 ms
c64 bytes from 192.168.1.128: icmp_seq=2 ttl=255 time=0.347 ms
^C
--- 192.168.1.128 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.269/0.296/0.347/0.036 ms

Okay, now let’s create a VNIC on net0

root@solaris:/home/jmoekamp# dladm create-vnic -l net0 vnic1
root@solaris:/home/jmoekamp# ipadm create-ip vnic1
root@solaris:/home/jmoekamp# ipadm create-addr -T static -a 192.168.1.250 vnic1/v4

Okay, at soon as you type the commands your network connection will stop to work. The reason is simple. VNICs doesn’t work together with VNICs.

client$ ping 192.168.1.250
PING 192.168.1.250 (192.168.1.250): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C
--- 192.168.1.250 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss

Okay, now login to your system and use the magic command:

root@solaris:/home/jmoekamp# nohup snoop -d net0 &

And now try to ping the new IP-Address again.

client$ ping 192.168.1.250
PING 192.168.1.250 (192.168.1.250): 56 data bytes
64 bytes from 192.168.1.250: icmp_seq=0 ttl=255 time=0.369 ms
64 bytes from 192.168.1.250: icmp_seq=1 ttl=255 time=0.222 ms
64 bytes from 192.168.1.250: icmp_seq=2 ttl=255 time=0.225 ms
^C
--- 192.168.1.250 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.222/0.272/0.369/0.069 ms

And now it works :) As long as the snoop runs. When the snoop doesn’t run, it doesn’t work. And when you think about it, this behaviour is perfectly reasonable :)