HowTo:Update Xubuntu Virtual Machine to Feisty (7.04)

From XastirWiki

Jump to: navigation, search

Contents

[edit] Before you begin: Decide how you'll upgrade

There are two main upgrade techniques to go from Xubuntu 6.10 to Xubuntu 7.04. One is entirely done over the internet, and requires a fast internet connection throughout the upgrade process. The second involves downloading an "ISO" image of a CD, burning the image to a CD, and upgrading using that. For details, please see the official documentation at the Xubuntu Web Site. I will not duplicate the entire instructions here.

[edit] Cautions if you choose the CD upgrade path

If you choose to upgrade using the CD, please download the "PC (Intel x86) alternate install CD", and double check you're getting the "Xubuntu" cd, not the "Ubuntu" or "Kubuntu" CD! You also do NOT want the "PC (Intel x86) Desktop Install CD" --- this is meant for first time installs, not for upgrades.

After you've downloaded the CD ISO and burned it to physical CD media, please, please, please double check that there are no errors on the CD. This is easy. Simply place the CD in your CD drive and reboot your computer (I would do this in the real computer instead of the virtual machine, but I imagine you could do it in either). It should boot up a menu screen that includes "Check CD for defects" --- choose that option. Please, please, pretty please choose that option, and let it complete.

I made the mistake of *not* running the "Check CD for defects" option before trying to upgrade my primary laptop machine, and naturally the CD had defects that were not a problem until the upgrade was nearly half done. The result was several hours of fixing up a broken upgrade. When I updated my daughter's laptop the next day, I did so with a different CD that I had checked for defects (twice!), and the upgrade went flawlessly the very first time. So please heed the voice of sad experience.

[edit] Cautions if you use the on-line upgrade path

I have not done this type of upgrade, because I do not have high-speed internet at home. But please be sure your connection is good and is stable before trying it --- having your internet connection go down half-way through the upgrade is likely to be a fast track to a Very Bad Time. But I have no experience with this on-line upgrade method, so perhaps it is more fault-tolerant than the CD upgrade path (I don't think that's likely, though).

[edit] First make sure your 6.10 system is up-to-date!

However you proceed, you *must* get your Xubuntu 6.10 system patched up to date before trying to upgrade to Xubuntu 7.10. Make sure you're connected to the internet, and run the Update Manager from the "Applications->System" menu, click the "Check" button to check for updates, and install all of them that are reported as available. Do NOT click the "Upgrade to 7.04" button at this time, you're not upgrading to 7.04 yet, you're simply updating your 6.10 system.

[edit] STOP HERE!

Once you've decided how you're going to upgrade and updated your 6.10 system, STOP. Do NOT upgrade your system yet, you have a very important step to do first, or you will have some problems running your virtual machine after the upgrade. It is not catastrophic if you have already upgraded, but it makes life a little easier to fix the vmware bug before the upgrade rather than after.

[edit] Before you upgrade: fix a vmware tools bug

The VMware tools that were distributed with VMware Workstation 5.x (on which the virtual machine was built) have a problem in the vmxnet driver source code. The most recent Xastir virtual machine with Xubuntu 7.04 already has this issue fixed. However, if you try to update your older Xastir/Xubuntu 6.10 virtual machine to Xubuntu 7.04 "Feisty Fawn", the first time you run "vmware-config-tools.pl" you will find that the config program will tell you that the various kernel modules you need don't work in the new kernel, and when it tries to rebuild them from source it will fail due to this problem. Fortunately, the fix is very, very simple, but it takes a few steps. You should do this *before* you attempt the Xubuntu upgrade, because it is easy to revert the changes back to a working state if you make a mistake, and if you do it right then the upgrade will be smooth and painless.

VMware tools kernel module source code is present in your virtual machine in the /usr/lib/vmware/modules/source directory in a series of "tar" archives. To do the fix, you will need to back up the vmxnet.tar file, unpack it elsewhere, edit the single problem file, then regenerate the archive file and move it back to the correct directory. Once done, vmware-config-tools.pl will build the vmxnet driver properly even under Xubuntu/Ubuntu 7.04 "Feisty Fawn."

[edit] Back up your vmxnet driver source code

First, you need to save the original driver source code so that you can always go back to the pristine state if you make a mistake. This is simple.

 cd /usr/lib/vmware/modules/source
 sudo cp vmxnet.tar vmxnet.tar.orig

Please do not skip this step!

[edit] Unpack the vmxnet driver source code

 cd /tmp
 tar xf /usr/lib/vmware/modules/source/vmxnet.tar

This will create a "vmxnet-only" directory in /tmp, filled with the vmxnet driver's source code.

[edit] Make the fix

The fix is to the file "vmxnet.c" in the vmxnet-only directory. The problem is that the code has a number of "ifdef" lines that make the subroutine "vmxnet_interrupt" be defined with different numbers of arguments for versions of the Linux kernel with version lower lower than 2.6.19 than it does for kernel versions 2.6.19 or higher, but the single use of that function is not similarly "ifdefed" --- this leads to a compilation failure when you build under the newer kernel in Feisty(7.04). The fix is to wrap the call to vmxnet_interrupt in the same ifdef that its definition is wrapped in.

Once the source code is unpacked as described above, you need to unprotect the vmxnet.c file:

 cd vmxnet-only
 chmod u+w vmxnet.c

Now you can edit the file and save your changes. Use an editor of your choice. Most Linux nerds will recommend using "vi" as the editor, but if you haven't used it before you might find it a little tricky to figure out. Try using "gedit" which will have a very intuitive interface. Whichever editor you use, you'll be making the same simple change.

Edit vmxnet.c and find the line near the end of the file that reads:

 vmxnet_interrupt(dev->irq, dev, NULL);

This is the problem line, as "vmxnet_interrupt" only needs two arguments under Linux Kernel 2.6.20. Add the following line right before that line:

 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)

and add these lines *after* the vmxnet_interrupt line:

 #else
 vmxnet_interrupt(dev->irq, dev);
 #endif


Once you've changed that one line into 5 lines it should look like this:

 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
 vmxnet_interrupt(dev->irq, dev, NULL);
  #else
 vmxnet_interrupt(dev->irq, dev);
 #endif

Now save the file and exit your editor.

Finally, you need to re-protect the file:

 chmod u-w vmxnet.c

[edit] Repack the archive

Now you need to pack all the stuff you unpacked back up into a new tar file.

 cd /tmp
 tar cf vmxnet.tar vmxnet-only

[edit] Put the repacked archive where vmware-config-tools.pl can find it

We're in the home stretch. Now you just have to copy this new archive back to the original vmware directory. BEFORE YOU DO THIS: Please double check that you did in fact save the original copy of the tar file as a back up. If you did not, and you made a mistake editing the file above, then you won't be able to recover the original easily! Please triple check this now. And if you don't back up the original vmxnet.tar before doing the next step, please don't come crying to me, because I'll just point at this paragraph and wag my finger.

 sudo cp vmxnet.tar /usr/lib/vmware/modules/source

That's it, the fix is in place.

[edit] Test your fix

This last step is very important. You want to make sure your fixes actually didn't break vmware tools!

 sudo vmware-config-tools.pl

This should prompt you for a bunch of things that you can just hit the enter key for, and when it gets to the bit about trying to build kernel modules, it should build them all and say they run perfectly in the current kernel.

Note that vmware-config-tools.pl will disable your networking in your virtual machine because it had to change the kernel modules that allow networking, and needed them to be unloaded when it did so. As it exits, it will print out a list of commands that you can run to re-enable the networking. Or you can just reboot your virtual machine.

That's it, vmware tools is ready for you to upgrade the system to Feisty!

[edit] If the testing fails

If there were errors in vmware-config-tools.pl, then go back and restore your original vmxnet.tar and try again:

  cd /usr/lib/vmware/modules/source
  sudo cp vmxnet.tar.orig vmxnet.tar

[edit] Now it's time to upgrade your Xubuntu install

Go back and check the first to major headings. You need to be sure that your Xubuntu 6.10 is completely updated before trying to upgrade to 7.04. You also want to make sure that your vmware tools are fixed.

Now you can upgrade.

Please go to the Xubuntu Feisty Release Announcement page and follow the instructions for upgrading. The process is simple enough, but the Xubuntu site can explain it better than I can.

--

Views
Personal tools
Navigation