Quick how to on installing VMware server under Ubuntu.
#become root sudo -i
Open file /etc/apt/sources.list You’ll see the following commented lines (starting at line 50):
# deb http://archive.canonical.com/ubuntu gutsy partner # deb-src http://archive.canonical.com/ubuntu gutsy partner
Uncomment both of them by removing the leading # character. Save the file, exit. Update the cached package lists (this will add packages from the sources we added above):
Now we’re ready to install VMware. If you’re using 64-bit Ubuntu (which is my case), then some additional packages will be installed along with the VMware package. This is because VMware is a 32-bit binary and needs 32-bit libraries. But apt-get takes care of everything for us. Run:
apt-get install vmware-server
After the install, a text-mode wizard pops up. Press tab to go to ok, press enter to ok, enter for Yes, and then type a VMware serial number. You can get the serial number from http://register.vmware.com/content/registration.html. Make sure you select Linux in VMware’s page. I usually ask for 100 serial numbers in one shot, save them to a text file, and use them one at a time. Either way, get your number and enter it into the wizard.
VMware Server is now installed. Since it’s a server product you are not required to run the X Window System in the host machine (which I don’t). You can start, stop, suspend, tickle and fondle your virtual machines using the command-line binary /usr/bin/vmware-cmd. Sadly you do need a graphical interface when you first create a virtual machine. Hence you must run the VMware Server Console, which does require X or Microsoft Windows. In Linux, the binary for the VMware Server Console is /usr/bin/vmware. You have three options:
- Install X in the host machine itself (the one where we just installed VMware). I never install X on my servers, so this is not an option for me. But if the host machine already has X or if you don’t mind installing it, this is the easiest solution.
- Run VMware Server Console from another Linux box that does have X installed. You do need to install VMware in the remote machine to get the Console binary. If the remote machine is Ubuntu, you already know what to do
- Run VMware Server Console from a Microsoft Windows machine. Since MS-Windows is my desktop of choice, that’s what I do.
The upcoming VMware Server 2.0 has a web-based server console, so there will be no need worry about the console. Any machine with a browser will do (go VMware!). Also, the console is rarely used – pretty much only when you’re adding a new virtual machine. Now, there is a bug in the vmware-server package that prevents a remote VMware Server Console from connecting to the host machine. If you try that now, you’ll get the dreaded:
There was a problem connecting: Login (username/password) incorrect
To troubleshoot this issue you would look into /var/log/auth.log. Here’s what happens when I do tail -f /var/log/auth.log and then try to connect remotely using VMware Server Console:
Mar 15 17:23:27 subhuman vmware-authd: PAM (vmware-authd) illegal module type: @include Mar 15 17:23:27 subhuman vmware-authd: PAM pam_parse: expecting return value; [...common-auth] Mar 15 17:23:27 subhuman vmware-authd: PAM (vmware-authd) no module name supplied Mar 15 17:23:27 subhuman vmware-authd: PAM unable to dlopen(<*unknown module path*>) Mar 15 17:23:27 subhuman vmware-authd: PAM [error: <*unknown module path*>: cannot open shared object file: No such file or directory] Mar 15 17:23:27 subhuman vmware-authd: PAM adding faulty module: <*unknown module path*>
So it’s a PAM issue. It turns out the VMware server package installs a bad /etc/pam.d/vmware-authd file. Now, one of the best aspects of Ubuntu is its awesome community: you can google almost any problem and find an up-to-date, correct answer. This is true in this case, and the solution is given by Walter Tautz in the bug report for this issue. Edit /etc/pam.d/vmware-authd file and replace its contents with:
auth sufficient /usr/lib/vmware-server/lib/libpam.so.0/security/pam_unix.so shadow nullok auth required /usr/lib/vmware-server/lib/libpam.so.0/security/pam_unix_auth.so shadow nullok account sufficient /usr/lib/vmware-server/lib/libpam.so.0/security/pam_unix.so account required /usr/lib/vmware-server/lib/libpam.so.0/security/pam_unix_acct.so #%PAM-1.0 @include common-auth @include common-account
And we’re done. You have VMware running and ready to go. Create virtual machines using the Console and manage them via /usr/bin/vmware-cmd.