I have a Windows 2000 Server running ColdFusion connected to a Microsoft SQL Database. I use this to run the company inventory database as well as for web development. I also have Apache, PHP and mySQL running on my Kubuntu workstation. Also on my Kubuntu workstation is a virtual server with Windows XP, Windows Vista, and Windows 7 beta installed. I have been thinking it is time to consolidate to free up some resources on my workstation as well as take advantage of moving W2K to a virtual server.

I decided to build a Ubuntu LAMP (Linux/Apache/mySQL/PhP) Server with VirtualBox installed on it. Since Ubuntu Server does not have a desktop installed, the virtual server would have to be headless; which means anything running on the virtual server would have to be accessed via Remote Desktop.

...

I found an article on HOWTO: Setup Headless Sun xVM VirtualBox 2.0 on Ubuntu Server 8.10 – Windows XP. This article was a good starting point however when I tried to install VirtualBox I received an error that the kernel module could not be built as the kernal sources could not be found. Well the article said there would be some dependency problems and gave the command to run next... it didn't work.

I tried several different things and did some more research. My problem is I am a geek, but am still learning (shouldn't we all be?). So, after a couple of tries I finally got virualbox installed and here is how I did it.

1. Installed Ubuntu Server.
    a. Downloaded the server image from the Ubuntu website.
    b. Burned the server image to a CD.
    c. Booted the PC from the CD and followed the directions.

2. Installed openssh-server so I could remote into the server command prompt.
    a. sudo apt-get install openssh-server

Note: Additional software will be installed to the Ubuntu Server using apt-get. Here is the APT HOWTO for managing packages. The packaging system uses a private database to keep track of which packages are installed, which are not installed and which are available for installation. The apt-get program uses this database to find out how to install packages requested by the user and to find out which additional packages are needed in order for a selected package to work properly.

3. Update the package list.
    a. sudo apt-get update

4. Upgrade the installed packages to the latest version.
    a. sudo apt-get upgrade

5. Install Dynamic Kernal Module Support (dmks) which will take care of upgrading the Virtualbox kernel module if the Linux kernel is upgraded.
    a. sudo apt-get install dkms

Now we are ready to install the VirtualBox virtual server. Download the latest version of VirtualBox here. and save it on the Ubuntu server.

6. Install the VirtualBox software.
    a. sudo dpkg -i virtualbox
    b. This will generate some dependency errors....

7. Fix the dependency errors.
    a. sudo apt-get -f install

8. Here is where the compilation of the kernel module failed because the Linux kernel sources could not be found. Looking at the error I checked which kernel is installed and then tried to install the linux-headers for that version. That did the trick.
    a. uname -r showed the Linux kernel to be version 2.6.27-7-server
    b. sudo apt-get install linux-headers-2.6.27-7-server

9. Assign the user to the vboxusers group
    a. usermod -a -G vboxusers jim

10. Are now ready to compile the vboxdrv and start the virtual server.
    a. sudo /etc/init.d/vboxdrv setup

Hopefully that was good for you as well. We are now ready to install the guest OS. I installed Windows 2000 Server and so named the installation W2KServer. It really doesn't matter what you call it, just replace W2KServer with the name of your installation. These instructions follow that of the HOWTO mentioned above.

11. Install the Guest OS.
-create a vm
    VBoxManage createvm -name W2KServer register
-config vm
    VBoxManage modifyvm W2KServer -memory "256MB" -acpi on -boot1 dvd -nic1 nat
-create a disk
    VBoxManage createvdi -filename "/var/vbox/w2kserver.vdi" -size 20000 -register
         Disk image created. UUID: 7c2d83a4-11de-4699-be4f-eeabd2230333
-add disk to vm
    VBoxManage modifyvm W2KServer -hda "/var/vbox/w2kserver.vdi"

Copied the W2K Server CD and created an iso image.
Copied it to home directory on the Ubuntu server.

-register an install iso
    VBoxManage registerimage dvd ~/w2kServer.iso
-mount iso on vm
    VBoxManage modifyvm W2KServer -dvd ~/w2kServer.iso
-start the vm with port
    VBoxHeadless -startvm W2KServer -p 3389 &

Used Remote Desktop Connection client to connect to the virtual server. Should see the Windows installation.

12. After Windows Server was installed, I installed the VBoxGuest Additions.
- get the VBoxGuest Addition
    wget http://download.virtualbox.org/virtualbox/2.1.4/VBoxGuestAdditions_2.1.4.iso
    wget http://download.virtualbox.org/virtualbox/2.1.4/VBoxGuestAdditions_2.1.4.iso
- move it to /var/vbox
    mv VBoxGuestAdditiond.iso /var/vbox/VBoxGuestAdditiond.iso
- register the image
    VBoxManage registerimage dvd /var/vbox/VBoxGuestAdditions_2.1.4.iso
- mount in guest OS
    VBoxManage controlvm W2KServer dvdattach /var/vbox/VBoxGuestAdditions_2.1.4.iso

13. Now to install Microsoft SQL Server 2000
- register SQL Server iso
    VBoxManage registerimage dvd /home/jim/sql2000_std.iso
- mount in guest OS
    VBoxManage controlvm W2KServer dvdattach /home/jim/sql2000_std.iso

Now that the Windows Server is installed, I still need to install service packs and updates. The network is by default configured using Network Address Translation (NAT) which probably won't work very well as it is on a different subnet from the rest of my network.

14. Switch the networking from NAT to hostIF. This connects guest OS NIC to the host NICC.
    a. VBoxManage modifyvm W2KServer -nic1 hostif -hostifdev1 eth0

15. Some other commands that may come in handy:
VBoxManage controlvm W2KServer poweroff
VBoxManage controlvm W2KServer reset
To add a shared folder to a virtual machine:
VBoxManage sharedfolder add "VM name" -name "sharename" -hostpath "C:\test"

FOLLOWUP: Well I have had this configuration up and running for a week now and am quite pleased with how it is working. I started out with 1GB of RAM and almost immediately increased it to 2GB. I also have a new 320 GB Hard Drive on the way. So far I have moved my inventory database to the virtual Windows 2000 server, all of my websites as well as eGroupware to the Ubuntu Server. I have mounted my home directory on my workstation to a folder on the root of the Ubuntu server and made it available to the W2K server. Oh, I also have Windows7 Beta and Windows XP running. This is accomplished by changing the port number of the startup command. VBoxHeadless -startvm W2KServer -p (port#). Then to bring up the desktop in Remote Desktop I just enter the <address of the Ubuntu server>:port#.

No feedback yet