Update: Since Microsoft has removed the scripted install from the VMA for Linux package, I’ll make the one I used when writing this article available. Keep in mind that Microsoft claims that the new RPM’s are compatible with Suse 10, so you may want to try those first. Virtual Machine Additions for Linux
This started as a simple project of keeping the time on my server correct. This would not only ensure that the post times were accurate, but also, I would be able to tell when people were reading my blog and such. NTP wouldn’t work, it might work once, but soon the clock was way off again. I found the reason to be that some algorythm for detecting lost ticks causes NTP to make the clock run much faster on the virtual machine than it should. I also found another NTP-ish utility that polled the chosen NTP server every couple of minutes, or so. This looked promising, but they noted that you should own the NTP server that you are polling as this will generate a lot of traffic.
After searching for hours I found that Microsoft had a beta Virtual Machine Additions for Linux. This is just what I was looking for… it includes time synchronization, not to mention the better hardware virtualization, offline shutdown, and the heartbeat (sort of a status monitor). Suse 10.2 wasn’t in the list of supported operating systems, but Suse 10.0 was… how different could they be, right? Yea, right. Further confusing the issue, the readme file states, “The Additions installation is guarenteed to work only on target systems where no manual changes have been performed to the system configuration after installation of the virtual machine.” Well, I was making manual changes within an hour of installing the virtual machine. Just another obstacle, if it were easy, everyone would have suse 10.2 running their web server from a virtual machine :).
Well, I got onto the Virtual Server configuration page and told it to install virtual machine additions (after upgrading to Virtual Server 2005 R2 Service Pack 1 Beta and running the msi file that came for VMA for linux… of course). Now don’t get me wrong… I had no delusions that it would be as easy as checking a little box in a browser page, and right I was.
Well that little checkbox is pretty stupid… there must be very little logic behind it, since it was fairly obvious that Virtual Server knew I wasn’t running Windows as my guest OS, it still loaded the Windows VMAdditions iso in the virtual drive. Of course, I had to figure out how to mount the CD-Rom before I found that out. Did I mention, I’m still a newbie with linux, sure I can get around the command line some, but with most things, I am clueless. I added the necessary line to my fstab and mounted it… all as root… of course. However, I had left my limited account logged in and on the mount point. This wasn’t a big deal until I found out that simply inserting the correct iso would not give me access to it. So naturally, I try to umount… it fails. After trying unmount for about an hour, unsuccessfully. I am giving up for now. Wait a minute, after exiting the root login, I found the problem I noted above. So, I cd home, su and try again… SUCCESS! I have access to 5 or 6 rpm’s and a shell script. I instinctively try to run the shell script, but don’t have execute permissions, so I move it to the hard disk and set the permissions. Okay, now I’m ready to try again.
Well, I got a kernel error, hmph. Okay, that’s to be expected… afterall, I’m not using a supported version of linux. I tried the rpm and got excited when it didn’t show any errors, this excitement was quickly followed by disappointment when I checked the log and found the same error. Well, the error said I may not have my kernel source, so I say to myself, “Self, if you were the kernel source, how would you like to be installed?” Why, Yast… of course. After a quick little yast2 -i kernel-source, I had the source files. Great, but the error remains.
Okay, okay, there was also a reference to a file in the error message, /lib/modules/2.6.18.2-34-default/build/MAKEFILE. Well, let’s see what’s there. Just a single file existed in the build directory… and it wasn’t called MAKEFILE, so began my search of the web, which continued for days. I was trying all kinds of things that various sites said to try. In most of the forums that I saw suggestions, the person having trouble did eventually get it to work, but they were also using supported distributions of linux. Needless to say, their suggestions only helped by helping me to eliminate possible problem/solution scenarios.
I was just about ready to give up and had already started researching other ways to help my server keep time, when I decided to look around and try to find the MAKEFILE myself. It took a ls -laF in the /lib/modules/2.6.18.2-34-default directory for me to realize that the build directory is just a symbolic link… wait, I’m not looking in the right place. So I skip on over to /usr/src/linux-2.6.18.2-34-obj/i386/default (where the link was pointing).
Well, there’s nothing of note here. So I start checking the parent directories and lo and behold, in /usr/src there is another linux source directory, 2.6.18.8-0.1-obj. So, I look and sure enough, there is an i386/default, as well… and it has a MAKEFILE. WOOHOO! Hold on now, don’t get too excited, we still need to find a way to make the install script look here for it.
Altering the script is out… it’s CRC’d and MD5′d, and I don’t know enough about it to take the checks out, or even update them to be correct. Oh yea, it’s a symbolic link… I can make a new one. Well, after mv build build1, I needed to create the symbolic link, something I’ve never done before. I tried different commands for an hour before I finally came up with ln -T /usr/src/linux-2.6.18.8-0.1-obj/i386/default -s /lib/modules/`uname -r`/build. Nice, I got a symbolic link. So, I cross my fingers and run the install script… SUCCESS. Now, there are still a lot of warnings in the log file, but it installed. A simple /etc/init.d/vmadd start verified it.
In Yast, once again. I navigated to the System Menu, then to System Service (runlevel). In there I was able to see 5 services that started with vmadd. The start at runlevel for all of them is set to 3 and 5… looks good, except vmadd-scsi, which I don’t need, so I unchecked the 3 and 5. Then, I proceeded to start each of the other services. As soon as I had, I saw the Virtual Server admin screen change to accomodate for the installation. I quit yast and issued the date command… IT’S RIGHT, the time and date are right on. WOOHOO!
So, while it wasn’t easy, it is certainly very possible, even for a linux beginner like myself. I’ll give as full of a list of commands to get it working as I can. Just click the link if you don’t see the code section below. (Continue reading…)
Sphere It