After weeks of waiting and pain in backing up my laptop, I got a new Dell Latitude D630. This system has the new virtualization hardware so that I can do a HVM (hardware virtualized machine). I tried doing this with a Dell D620 but the hardware did not support virtualization.
1) backup the existing laptop. I wanted to make sure I didn’t loose the WindowsXP image since they are getting harder and harder to find these days.
2) remove the disk that is in the laptop and put in another disk. I really believe in backing up an image that works. I didn’t want to scratch anything that works because getting it to work on the corp network is a real pain.
3) boot the laptop into the BIOS and turn on vitrualization. By default it is turned off. It was a little difficult to find but it was under the system settings and was clearly labeled virtualization. I had to walk through all options to find it.
4) boot the laptop from the VM Server cd. This allows me to configure and start the VM server on the laptop. The system comes up in a Linux kernel with no X Window operating system. The command line login: is the only friendly prompt presented.
5) configure the VM Master to recognize the VM Server as a system that I can manipulate. I also made this system the pool master and utility server. I typically would have made another machine this but given that I only have two laptops I did what I could. In retrospect, it would have been nicer to have the VM Master be the utility and pool master but that isn’t possible since the pool master has to be part of the pool. It would have been nice to make the VM Master the utility server as well.
6) download the HVM and PVM templates from the otn.oracle.com site. I downloaded all of them so that I could play with them.
7) download the Linux iso files so that I can play with installing and configuring virtual machines from scratch if needed and create my own templates
8) convert a Windows installation CD into an iso so that I can boot from it as well. I did this on the VM Server by using the following command
$ dd if=/dev/cdrom of=WinXP.iso
When the command finishes I have a bootable copy of the Windows XP CD and just need to keep the product key handy for the installation.
9) Just for grins I also downloaded the Solaris 10 x86 media and the Knoppix 5.1.1 media so that I can test different operating systems.
10) Once I had all the software downloaded, I had to copy it to the templates and iso images to my VM Master. The configuration that I have is as follows
home computer ———> hardware router ——-> internet connection
^
|
VM Master —————
| |
—–>wireless hub |
^ |
| |
VM Server —- |
| |
———————-
The ip address used by the home computer is 192.168.1.100. The VM Master is configured to be dhcp on the wireless hub and appears as 192.168.1.103. I wanted the VM Server to also work on the wireless hub but the installation did not see the wireless network when I installed the vm software. I configured the VM Master on the hardware connection to be at 192.168.2.222 and the VM Server to be at 192.168.2.200. These addresses need to be static and I wanted to see if I could use both the static and wireless interfaces on two different networks. The benefit of this is that I should be able to use the hardwired network for private communications and the wireless network for internet connection. The drawback to this configuration is that the VM Server did not recognize the wireless network so any communications to this system had to happen through the VM Master. I think that this is a problem that I can solve but I have not spent the required time to get it working. I have gotten spoiled with the GUI interfaces in Linux and forgot how to plumb a network interface and enable it from the command line. I think that I will try this after I get a few operating systems installed and working.
11) now that I have the iso images and templates on the VM Master, I need to configure the images to work on the VM Server. To do this I go into the console (http://localhost:8888/OVS) and login as admin. I created an account for myself and gave the account admin privs but I do not see the resources or approvals listings for images imported. I need to research this more because I do not want to have everything go through the admin account for iso and template approvals. To get the images to the VM Server I either need to ftp the images there, configure the VM Master to be an http server, or configure the VM Master to be an ftp server. I copied some of the images to the /OVS/iso_pool and /OVS/seed_pool directories so that I could import a local ISO or local template. This is done by going to the Resources tab, selecting the ISO Files sub-tab and clicking the import button. You get the option of External ISO or Internal ISO. If you pick internal, it looks in the directory structure of the /OVS/iso_pool and picks a directory there to import. If there are no new directories that have not already been imported, nothing will be shown to you. When you select internal iso you get a screen that shows Server Pool Name, ISO Group, ISO Label, and Description. It is important to note that the order of selection is critical. You can not select an ISO label before you have selected a pool name and ISO group. You need to select the Pool Name first. When you pull down this menu, it shows all of the pool servers that you have configured. In my case, there is one option, VMServer-1. Once I select this, the ISO Group pull down gets populated. If there are no new directories or iso files, you are not presented with an option and need to logout and log back in to clear the logic. This is a little crazy but it works. If you cancel, the cookies and scripting mechanism do not get properly cleared. If there are new iso directories and iso files in the iso_pool directory, the ISO Group label will reflect the directory name. You can easily test this by typing the following commands
$ cd /OVS/iso_pool
$ mkdir test
$ cd test
$ touch test.iso
When
you go into the ISO Internal import you should see the VMServer-1 as the server pool name, test as the iso group and test.iso as the iso label. The directory that we created, test, is effectively the ISO group. The file that we created, test.iso, is the ISO label that we create. We can create more files in this directory and associate them with the iso group. This is typically the case when you download four or five disks that make up a Linux distribution. If you can download a DVD image of the distribution, you will typically only have one file associated with an iso group. If there are multiples, you need to associate multiple iso labels to the iso group.
12) Now that we have a successful iso defined with a local import, let’s look at importing from an external iso. To test this, I configure the vmmaster to be an http server. To do this I configure the apache server that is installed with a typical Linux installation. I had to rename the /etc/httpd/conf.d/ssl.conf file to /etc/httpd/conf.d/ssl.conf.orig to disable the ssl connection. I didn’t want to hassle with certificate configuration and just wanted to get a simple http server up and running. I then created a link in the /var/www/html page to point to the directory that has all of the iso images. This was done with a ln -s /oracle/vm /var/www/html/vm. It is important to note that this worked because the /var and the /oracle directories are on the same disk. If they were not I would have to create a hard link or copy the files to the /var disk. Once I got this configured I was able to start the http server by executing the command
$ mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.orig
$ ln -s /oracle/vm /var/www/html/vm
$ sudo /etc/rc3.d/K15httpd start
The start responds with an error or an OK. The OK shows that the apache server is up and running. At this point I can go to a web browser on my home computer or on the vmmaster and goto http://vmmaster/vm and see a directory listing of the iso images.
13) Once I have the iso images available from http, I then go back to the external iso import. This menu option presents a server pool name, an iso group, an iso label, a url, and a description. The pool name is a pull down and only gives us the option of VMServer-1 since we have only one pool server. The ISO Group, ISO Label, and URL are text fields that we need to enter. I executed the following commands on the vm master to configure a dummy iso file as we did earlier on the vm server.
$ cd /oracle/vm
$ mkdir junk
$ touch junk/junk.iso
At this point we should be able to see the iso file by going to http://vmmaster/vm/junk and see the file of zero length. Just as a test, let’s enter test2 as the ISO group and test2 as the ISO label using http://vmmaster/vm/junk/junk.iso as the URL. When I do this I get a confirmation screen and get routed back to the list of iso files. In this wel see the ISO Label of test2, ISO group of test2, File Name of test2.iso, Status of Importing. When we refresh we see a status of Pending. We can approve this by clicking on the radio button to the left of the ISO label and selecting the Approve button above it. Once we approve it we see the Status of active. The directory structure created on the vm server is /OVS/iso_pool/test2 with a file containing test2.iso. It is important to note that even though we labeled the directory junk and file junk.iso on the vm master, the file comes across as test2 and test2.iso on the vm server. I was a little surprised by the external import function. I thought it would just register the location of the iso file and allow me to use it across the network. This is not the case. It actually copies the file from the URL location and copies it into the iso_pool directory. I would have preferred that it left it on the other server and left room for the vm images on the vm server.
14) Now that I have a proper iso image, I can create a virtual machine. This is done by going to the Virtual Machines tab and clicking on the Create Virtual Machine button at the top right. You are given the choice of installing from a template or media. We will choose to install via the media. The machine will go into the VMServer-1 server pool (since this is the only one that we have). We will select an iso file to boot from. In this instance I select the WinXP.iso file just to see if the Windows media installs properly. I also have the option of installing a fully virtualized vm or a paravirtualized machine. For Windows I have to pick the fully virtualized. The next screen allows us to name out vm, allocate memory, cpu, and disk as well as setting our console password. For this example I will create a 1 CPU system with 1G of memory and 8G of disk. Before I create the image, I make sure that I have 8G of disk space in the /OVS directory on the vm server. The file will be created in the /OVS/running_pool with the name I specify prefixed with a number. This number is generated by the vm master to uniquely identify an image just in case someone picks a previously used name. In this example I pick the Virtual Machine Name of test01, Operating System of Other, 1 CPU, 1024 of memory, 8096 of disk, and set the password to something I can remember. I also check the network interface card presented. In my case there is one and only one choice so it does not matter. Once I confirm this I get dropped back in the Virtual machines tab and have a status of Creating for the new machine that I created. This creates activity on the vmserver constructing the /OVS/running_pool/84_test01/System.img and /OVS/running_pool/84_test01/vm.cfg files. The System.img file is the disk for the virtual machine. Everything is kept in this file can can be moved from system to system as needed to run the vm on another hardware box. The vm.cfg file defines the operating parameters for the virtual machine including the device modek, disk location, kernel loader, and memory to allocate. It also associates a network interface and vnc parameters for remote console. The vncpassword is stored clear text in this file so it is important to make sure that your root password is not the same or a derivative of this password. The generation takes a while and when it is finished some audit logs are displayed to the vm server console and the status changes from creating to Running.
15) Now that I have a running virtual machine, I need to connect to the console. To do this I use the browser on the vmmaster. In the Virtual Machines tab I select the test01 vm and click on the Console button. When I first tried this on the VM Master box, I got a plug-in required. I tried going to download the plugin but did not find one. From the documentation I realized that I needed to configure the Firefox browser with the proper plugin and restart the browser
# cp /opt/ovm-console/etc/mozpluggerrc /etc/
# cp /opt/ovm-console/bin/* /usr/bin
# cp /opt/ovm-console/lib/mozilla/plugins/ovm-console-mozplugger.so
/home/oracle/firefox/plugins
I had to use the /home/oracle/firefox directory because I linked this installation to the browser launch button. I did not want to use the default browser that comes with Linux and preferred to use FireFox which I downloaded and installed separately. I tried to do the same thing from my home desktop which is running WinXP but the connection failed because I did not have a good java installation. I decided to work on this later and not work on it now.
16) once I got the console up and running (and the right password entered), I saw the boot screen for Windows XP. Everything worked fine until it came time to reboot the first time. The system went through all of the questions and selections and started to reboot. When this happened, something went wrong with the console connection. The vm never rebooted properly and I had to halt the vm, disconnect from the console, and restart the vm. I would have liked to keep the console up and running and watch the vm restart but I could not. If I have the console up and shutdown the virtual machine, the console shows that it was showing before the shutdown. I woul
d have expected to see the shutdown procedure or a message that the virtual machine was down but it remained a static image of what happened before the shutdown. To fix this I had to exit the console, restart the virtual machine, and restart the console. This isn’t a big issue, just something that I didn’t expect.
17) Once I got everything running and the way I wanted after a reboot I was able to shutdown the windows image into hibernation state as well as power off state. The resume from hibernation took me to the Windows login as expected. If I select the Turn Off Computer from Windows I see the Windows is shutting down note and from the vm master it appears that it is still running properly. I never see the shutdown or see the virtual machine go to a power off condition. This is a little disconcerning because I don’t know when it is ok to power off the machine. If windows is still saving state, I might loose something with a power off. It would be nice if the operating system power off would signal something to the vm master and put the machine in a power off state. This might be caused by the vm.cfg file parameters. I currently have on_crash and on_reboot set to restart. I might need to set them to something else or set another parameter to something different to power off the vm.
18) I was also able to delete the vm image once it was powered down. If the image is running (even though the OS is shutdown) I am not give the option of delete. I can only power off or launch the console. If I shutdown Windows, exit the console, and try to relaunch the console I get a Connection to vnc server failed: Connection refused. This is a good indication that Windows has finished but something more elegant would be appreciated. At this point I can power on the vm, delete it, clone it, save it as a template. If I try to do something like pause a powered off vm, I get an error message that the Virtual machine is not ready to be paused. I can clone the powered off vm. I just have to enter a new name, the number of copies, the pool server, and the group name that I want to copy it to. I see this being something very useful for development. I can work on something and create a golden master of a release. I can then close the os and application installation and branch the image for other people. That way we don’t corrupt each others test environments. In my instance I choose to create a virtual machine name: test020 with one copy into group name test.When I get back to the Virtual Machine page I see that winxp_test is in a state of cloning and test020 is in a state of creating. If I look on the vm server I see /OVS/running_pool/86_test020 being populated with a System.img and vm.cfg file. Once the audit record is displayed on the screen I can see that both images are in a powered off status. This process takes a while because the 8G System.img file is copied to the new directory.
more later…..