Virtual lab setup

Here is a high level overview of how my virtual lab is set up.

Tony Redmond’s “Exchange 2010 Inside Out” book is what inspired my current set up. Previously I had a desktop machine running Debian Linux & KVM with Windows and Linux machines as guests and I would Remote Desktop or SSH into these; but Tony’s book mentioned how cool he found it to be able to have a laptop with all his virtual machines as well as applications such as Word running side by side and it was fascinating that both were just an Alt+Tab away from each other. I too found it a fascinating idea, and I was in need of an excuse to purchase a new powerful laptop as well as move to a system where all my virtual machines were “in hand” and so that’s where I am now.

I purchased a Samsung NP550P5C laptop which I upgraded to 16GB RAM (the laptop has two slots and comes with 4GB in each). It runs Windows 7 and I installed VirtualBox as the hypervisor. I chose VirtualBox as it supports 64-bit guests, unlike Virtual PC, and I had trouble with my initial choice VMWare Server (Windows Server 2008 guests kept crashing upon reboot). I am glad I chose VirtualBox – so far it’s been a great experience and my only wish is that it supported some way of organizing guests in the virtual manager console into folders and let me manage them as a group (automatically start the guests in a particular delayed order, for instance)[Update: VirtualBox 4.2 supports grouping, headless launching, and autostart of VMs with the host system (not on Windows though)].

I have set my Windows 7 host task bar to the left. This way I can maximize the window of the guests and have them as sort of full-screen but with the ability to easily select other apps on the host with a mouse click. Further, I set Ctrl+Shift as the “host key” in VirtualBox, which means when I am in a guest I can press Ctrl+Shift and then Alt+Tab to any other guest or app. Or I can do Ctrl+Shift and then Win+ to switch to that app in the taskbar. I find that very neat.

desktop

Here’s a screen shot of a freshly installed guest.

Notice  how all the icons in the host taskbar are grouped except the VirtualBox ones? That’s thanks to the 7+ Taskbar Tweaker which lets me tweak the taskbar in many useful ways. Also, by default if you move the taskbar to any side the icons are large and ugly – but there is a workaround for that. Applying the workaround each time you login (or whenever the taskbar expands back to the large and ugly size as it tends to do sometimes) is a chore so I created a AutoHotkey script that does it for me.

In terms of the guests, I have a WSUS server guest to take care of the Windows updates. This way each guest does not have to keep downloading updates and clog my bandwidth. The WSUS server downloads and caches it. It is also a good experience for me to get familiar with WSUS.

When I think of WSUS I think of a battle tank. It feels that way – slow and lumbering. No fault of WSUS though; it is a very I/O intensive application what with all the downloading and storing in a database and that obviously takes a toll on its performance as a guest. A useful tip for when you install WSUS as a virtual guest is to limit the SQL Server process’s memory usage. The first time I tried WSUS I found that it made all my guests and the host slow and I saw that the WSUS guest was always eating up all the RAM allocated to it. A bit of Googling showed that this was a common complaint and there was a way to limit the SQL Server’s memory usage. I did that and since then WSUS is well behaved. Currently I have set aside a 2GB guest as my WSUS server and limited the memory usage of the SQL Server process to 1GB.

The WSUS server is also my gateway router for the virtual guests. I have many internal networks in VirtualBox (to simulate multiple LAN/ WAN segments) and have assigned each guest two NICs – one on an internal network and another for VirtualBox NAT. When a guest is on the VirtualBox NAT  the host acts as a DHCP server and assigns the guests dynamic IPs from the 10.0.x.0/24 range. The x corresponds to the instance of the NAT interface plus 2, so if your guest has 3 NICs and all three are on VirtualBox NAT then the first NIC will be on the 10.0.2.0/24 network, the second on the 10.0.3.0/24 network, and the third on the 10.0.4.0/24 network. Each NIC will have a dynamic IP from that networks’ address range, and the gateway will be set as 10.0.x.2 and the name server as 10.0.x.3.

It is not necessary to use the dynamic IP assigned by the VirtualBox host. Instead, you can assign the guests static IPs from that network and they will work fine.

In my case, once a guest is up and running I disable – from the guest – the NIC that’s assigned to the VirtualBox NAT. That way all guests are on the internal network with no direct access to the outside network. (I choose to disable the NIC from the guest rather than from the host as it’s easier if I ever want to enable internet access on a particular guest for some quick testing). As mentioned earlier, all guests also have the WSUS server set as the default gateway. And so on the WSUS server I assigned it’s NAT connected NIC a static IP, installed the Routing and Remote Access role, and enabled routing. Thus the WSUS server acts as a router for all the guests on the various internal networks.

Apart from that each domain’s DC also has GPOs that direct all the machines to connect to the WSUS server for updates, change the background to display information from the SysInternals BgInfo tool, and disable the irritating shutdown tracker. The WSUS server is (as of now) a standalone server.

That’s all for now!