Install VMware Tools on Ubuntu Linux - Reborn
Posted by Gorillapond in Linux, VirtualizationIf you work much with virtual machines, you know how important installing VMware Tools can be. Even without the graphical interface of Linux (called X11), there are a number of important features that installing VMware Tools offers you and you really shouldn’t skip it. I’ve struggled with installing VMware Tools on Ubuntu Linux in the past, and I hope you find this guide helpful in making it even quicker and easier. It seems newer versions of Ubuntu and VMware Tools broke my previous instructions. Luck for us, VMware and Ubuntu contributors have made the process easier than it was in the past.
Now for a little back story: VMware has released the source code for VMware Tools as an open source project called open-vm-tools located at Sourceforge. By itself, this isn’t helpful because open-vm-tools does not include an installer and therefore you would need to run shell scripts to merge the working bits of open-vm-tools into the traditional VMware Tools installer. Let’s all be glad we can avoid that mess.
Contributors of Ubuntu have taken open-vm-tools and created a installable package for Ubuntu, and included it in the standard software repositories so you can install it easily. This means upgrades should be much easier in the future, and these directions should hopefully continue to work into the future. Let’s get down to it.
Notes:
- I have tested this on Ubuntu 8.10 Server (Intrepid Ibex) but it should work just as well on the Desktop edition. If this doesn’t work for you, try my old instructions.
- This only sets up the basics of VMware Tools for a terminal install of Ubuntu, like Server edition. If you want the copy/paste integration and other goodies available for Ubuntu with a graphical interface, you need to install an additional software package called open-vm-toolbox in step 3. I’m not sure what else is required, please leave a comment if you figure it out.
- You must execute all of these commands either using sudo or otherwise with root-level access. This means putting sudo in front of the commands, or creating a root terminal with sudo bash.
1. Let’s get your virtual machine ready:
I’ll assume you just finished installing Ubuntu and we need to install all the updated versions of included software.
apt-get update
apt-get dist-upgrade
2. Reboot:
Since we probably just upgraded the Linux kernel, let’s reboot now to make sure we’re booted from the newest kernel.
reboot
3. Install the Ubuntu package for open-vm-tools:
Log back in and make sure you continue running these commands as root or using sudo.
apt-get install open-vm-tools
4. Bring back the network connection so we can continue:
At this point, the installation of the package killed your network connection for no good reason and we need it to continue. I hope you weren’t using SSH yet! Let’s bring the connection back up so we can keep working.
modprobe pcnet32
/etc/init.d/networking restart
5. Build and install the kernel modules:
The current version of the Ubuntu open-vm-tools package installs files in the right spots, but it doesn’t actually build the various kernel modules (drivers) necessary for VMware Tools to actually work. Let’s build them now.
Note: If the second command fails take a look at my comment below for a fix.
module-assistant prepare open-vm
module-assistant auto-install open-vm
6. Reconfigure and rebuild initramfs:
I’m a little sketchy on the details here, but from what I’ve learned, the boot process doesn’t have access to the VMware accelerated NIC (vmxnet) kernel module at boot time and it fails to load. So if we include it inside initramfs, it will have access to the vmxnet module, and we will get a network connection at bootup. Very handy!
echo vmxnet >> /etc/initramfs-tools/modules
update-initramfs -u
7. Reboot for the last time:
reboot
8. Dance!
At this point everything should be great! You have all the features of VMware Tools, and didn’t pull your hair out in the process! Win-win! You can do a little dance, nobody is watching!
Entries (RSS)
[...] Install VMware Tools on Ubuntu Posted by Matt Jones in Best Of, Information Technology, Linux, Virtualization Important Notice: This post has been updated using a newer, easier method. Read more here. [...]
[...] Ubuntu, and included it in the standard software repositories so you can install it easily. More here If you work much with virtual machines, you know how important installing VMware Tools can be. Even [...]
Dude, you’re awesome…this worked like a champ…thanks!!!!
This seems have worked, but I have to re-run the networking stuff after every reboot:
modprobe pcnet32
/etc/init.d/networking restart
Any ideas on that one?
You skipped over step 6, or the vmxnet module wasn’t built somehow for the network card.
dude, worked great. Just like last time.
Now I have to figure out what to use this virtual ubuntu server for…
This works just great but my end - Ubuntu 8.10 server 2.6.27-11 on VMWare server 2 - I get this:
sudo echo vmxnet >> /etc/initramfs-tools/modules
bash: /etc/initramfs-tools/modules: Permission denied
I thought I was giving the command as root - what more does it want?
the update-initramfs -u
gives no errors but I assume since it doesnt have the driver it needs to due to previous permissions error doesnt actually do anything because on reboot the networking is gone and one needs to
modprobe pcnet32
/etc/init.d/networking restart
to get it kicking.
To workaround the permissions I did this:
sudo gedit /etc/initramfs-tools/modules
added vmxnet to the end of the file, saved it and then did the update-initramfs -u and after reboot this seemed to work for me.
I think I was running the echo command from a root shell (sudo bash). You might have found an issue with running sudo with that echo command.
sudo echo vmxnet >> /etc/initramfs-tools/modules
should be
echo vmxnet | sudo tee /etc/initramfs-tools/modules
Thank you for this site!
It work great.
I am very new to UNIX. I have to do “sudo su” to get going.
I am running this in Server mode with no graphic of course. How do I change the screen size now that VMware tools is install?
The terminal screen can’t resize easily. If you want a larger screen size, I would install openssh-server and use PuTTY to connect. You can resize putty to anything you want.
Only catch with this method is that VMware server 2 doesnt seem to show on its VM info page that VMware tools exist - probably doesnt detect the open source version. No crisis since not affecting anything else AFAIK.
Worked great! Might want to warn people not to use ssh in step 3. Otherwise, you can hop on the console and perform step 4 and your ssh connection(s) will come back.
This is very true. I’ve kicked myself out of my server so many times because of this!
Thanks for this post, it worked great on Ubuntu 8.10 (Intrepid Ibex) Desktop and VMWare Fusion on Mac OS X.
Excellent, this works an absolute treat. You are a star. (Don’t suppose you could post Installing VMware Tools on Kubuntu 8.10, pretty please?)
From the comments, this looks like a great tut but I didn’t get any joy with Jaunty. Failed on “module-assistant auto-install open-vm”.
Looks like Ubuntu didn’t update their own package to work with the operating system. There’s a patch below that makes it work again.
Excellent, but one remark:
This will not work (not even with a sudo):
echo vmxnet >> /etc/initramfs-tools/modules
(not allowed to update file, you have to be root (that is what I saw on my fresh 9.04 Ubuntu)
So, I would change this into:
su -
echo vmxnet >> /etc/initramfs-tools/modules
update-initramfs -u
reboot
Yes, you have to be root to update that file, or run it as
sudo echo vmxnet >> /etc/initramfs-tools/modulesJust a note to everyone.. Ubuntu Januty (9.04) is currently broken using the open-vm-tools package. The second part of step 5 will fail. Looks like its logged as a bug already: https://bugs.launchpad.net/ubuntu/+source/open-vm-tools/+bug/362579.
There’s a patch linked on the bug page, download it to /usr/src (
wget http://launchpadlibrarian.net/25819719/vmhgfs-2008-11-18-jaunty-lenny.diff) and then run:patch -p0 < vmhgfs-2008-11-18-jaunty-lenny.diffFrom there you can rerun the auto-install command using:
module-assistant --not-unpack auto-install open-vmI think I figured out the problem, after the patch is applied, the command should be “module-assistant –not-unpack auto-install open-vm” (With 2 dashes before “not-unpack”). I realize now that this site may change double dashes into a long dash.
When I try to run the patch command I get:
“can’t find file to patch at input line 3
perhaps you used the wrong -p or –strip option?
…
…
File to patch:”
What do I do from here…?
You should be in /usr/src when running “patch -p0 < vmhgfs-2008-11-18-jaunty-lenny.diff”
I’m a newbie on Ubuntu. I have followed these instructions trying to install VMWare tools on Ubuntu Server 9.04 running as a vm in vmware fusion 2.0.4 including the updated step 5 with the patch.
I think its worked but how do I test this? I am really trying to mount folders on my mac and make them available to Ubuntu. I have shared them in the vm setting. How do I now mount them and test that my vmware tools install worked?
Googling suggests that my shared folders should show up under /mnt but this folder is empty. Thanks.
Thanks for this. It’s people like you that make the Linux community so great. I just wish there was a better way to organise this information so it’s easier to find. Thanks again.
I tried what Gorillapond said, but I still can’t get this to work on Jaunty (9.04). This is one reason why I hate dealing with Linux. The VMWare tools install quickly and easily on Windows, but for Linux it’s always a bunch of VooDoo and black magic to ever get anything to work right. Feh!
Check this out, it works perfectly for installing VMWare Tools on Ubuntu 9.04:
http://ubuntuforums.org/showpost.php?p=7285396&postcount=17
I would be cautious executing someone’s script like that. You have no idea what it’s doing unless you look at the code first. But if it works, it’s probably an automated version of the instructions in this post.
It’s downloading some large tar file from the same site (chrysaor.info) and runs some perl installation script. I’d be very cautious for such behavior.
I updated the post again using information that was discussed in the comments here.
Instructions ran fine, but the mouse is acting strange I have to click 3 or 4 times in the Ubuntu 9.04 guest window to allow input.
Also player screen wont resize, cut and paste between the guest and host wont work either.
I’m running Ubuntu 9.04 in player 2.5.1 on a WinXP host.
You ever have one of those things where you search everywhere for a HOWTO to know avail then, like a bright shining light, you just stumble across one that tells you exactly what you need to know. This is that beacon of light for me…thanks!
I am very new at Linux also. I tried installing using this procedure, the install completed but the drivers never loaded (the mouse is slow and the screen is still small). So I figured out how to let VMWare install the drivers (using the virtual CD process) but it will not load them since it says that vmhgfs, vmxnet … are alreadyinstalled, but not by the vmware installer). I have no idea how to undo the install process you provided here and I can not get the ones I just installed to work. I need some help!
Thanks
love to try this, but step 3 currently fails under a default installation of 8.04.3…has the package been withdrawn?
Thanks for the guide! I gave it a go for Ubuntu Karmic 9.10 and it seems to largely work (in fact it doesn’t seem to disconnect pcnet32 anymore), but invoking “Shutdown Guest” from VMware (I’m running 1.0.8) doesn’t seem to be working. It just does a power off.
Anybody know what I might be missing? Will this work if I run VMware 2+?
I’ve followed the instructions here for the sole purpose of getting copy-paste functionality from my OSX host to my Ubuntu 9.10-server guest to no avail. I thought perhaps there was a keybinding problem and added “\C-v: paste-from-clipboard” to my /etc/inputrc to no avail.
Has anyone else had trouble with this or am I missing something obvious?
Of course, I could always be smart and just SSH into the VM… duh. ; )
mount -t vmhgfs .host/ /home/ /shares