Changing IP subnets on a network containing OSX Lion Server running Virtualbox

…on a Friday afternoon in July.

I decided to finish setting up VPN access to the office and part of the process was to change our local subnet of “192.168.1.0” to “192.168.x.0” (for x > 1) to avoid ip address conflicts with most home routers. It’s not a difficult process, but I did encounter a few stumbling blocks along the way and I have noted them below.

Obvious Tip of the Day: Change your TCP/IP settings on all devices that have IP settings manually configured.

Our OSX Lion server has its IP address manually assigned on the server itself, and luckily I was smart enough to have changed the IP address on the machine before making the subnet change. Unfortunately, I did not remember about the virtual machines that live in Virtualbox on the Lion server. After reconfiguring the router with the new subnet information I was left without my dev linux servers or the ability to access the internet. Here’s why:

Virtualbox does not like moving subnets

After rebooting the Lion server, my VMs (which normally start at boot) did not come back online and I was unable to connect to them using the Virtualbox GUI, even though the GUI suggested they were stopped. I believe I was getting an “access denied” error.

I unloaded the VMs .plist from OSX’s LaunchDaemon and started the VM manually via the VBox GUI, but once the machine had loaded to the login prompt I couldn’t type into the console! Also, when checking the settings for each VM showed a “Invalid Settings Detected” message at the bottom of the dialog.

Eventually I found that the problem was related to the subnet change having hosed VirtualBox’s virtual network interfaces.

The Fix

I added a new virtual interface by going to Virtualbox Preferences, Network, and clicking the plus (+) button to add a new interface for each VM. Not only did this give me the ability to interact with each VM via the VBox GUI, but it also allowed the VMs to reconnect to the network (obviously). Woohoo!

Except the ugly “Invalid settings detected” error was still displayed in the settings dialog for my VMs, which also has the nasty side-effect of disabling the OK button so you cannot change any settings.

The Fix, part 2

More googling research eventually let me to a forum post that solved my problem.

Run the following command:

$ VBoxManage showvminfo “Your VM Name”

If you see the following line:

[code]VRDE: enabled (Address 0.0.0.0, Ports , MultiConn: off, ReuseSingleConn: off, Authentication type: null)[/code]

Run this command:

$ VBoxManage modifyvm “your VM Name” –vrde off

Voila! Error message gone and you can edit your settings again.

Of course this is a band-aid fix and you should really understand what VRDE does before leaving it off indefinitely, but it’s Friday afternoon and I’m going home. See ya!

Leave a Reply