VMWare is a company specializing in virtualization products which allows guest “virtual machines” to run inside a host operating system. They have a number of products including the free VMWare Player and VMWare Server applications, and paid for applications such as VMWare Workstation.
I have been using VMWare Workstation since 2003 to run Microsoft Windows XP inside my Linux host computer so I can continue to run applications such as Adobe Photoshop and test websites with Internet Explorer and Mozilla Firefox on a native Windows platform. It’s also extremely useful for testing out Linux distributions without having a dedicated computer to install them onto.
I returned to using Windows in 2008 but continued to use VMWare for testing IE and running my development Linux web server; from 2010 I switched to OSX and continue to virtualize Windows for testing web applications on Internet Explorer.
VMWare Fusion on Mac OSX allows you to shrink virtual disks easily for Windows virtual machines right from the graphical interface (Virtual Machine -> Settings -> General -> Clean Up Virtual Machine) but there isn’t the same option to do this with Linux, so you need to do it from the command line.
I recently replaced my Windows Vista desktop/host machine with Windows 7 Release Candidate and switched from VMWare Server version 1 to VMWare Server version 2. Version 2 uses a web based management interface and each virtual machine can be accessed in a separate remote console.
I needed to connect a USB printer to one of the virtual machines and was surprised to not see any USB devices shown in the “Devices” drop down box in the remote console. This is shown in the first screenshot below where you can see the virtual CD/DVD devices and network adapter but no USB devices:
For some reason these don’t show up under the devices drop down box so you have to go into the web management console and connect the USB device there. This is shown in the screenshot below where the red arrow (added for the screenshot) shows the USB device drop down box.
Click the USB button and it shows the devices that can be connected. This isn’t the most convenient way of connecting a USB device (it would be easier if the USB devices were shown in the device drop down in the remote console) but at least it can be done.
I use VMWare Server on several different computers to run virtualized Linux webservers for developing websites and for testing various versions of Internet Explorer. I recently needed to reduce the size of a Linux virtual disk to fit it onto a USB stick to copy to another machine but simply deleting files does not reduce the size of the disk image. This post links to another article offsite which shows how to do this and adds a couple of notes about it.
I’ve just set up a new VMWare virtual machine with Kubuntu 8.04 and the scroll wheel on my mouse didn’t work. The steps to correct this are pretty simple and are covered in this post. This should work for any Ubuntu/Kubuntu variant when running in VMWare.
In a terminal session open the /etc/X11/xorg.conf file. The following command illustrates doing this with the “nano” text editor:
sudo nano /etc/X11/xorg.conf
Locate the section labelled “InputDevice” which, by default, should look like this:
Section "InputDevice" Identifier "Configured Mouse" Driver "vmmouse" Option "CorePointer" Option "Device""/dev/input/mice" EndSection
Add the following to it:
Option"Protocol""ImPS/2" Option"Buttons""5" Option"ZAxisMapping""4 5"
so it now looks like this:
Section "InputDevice" Identifier "Configured Mouse" Driver "vmmouse" Option "CorePointer" Option "Device""/dev/input/mice" Option"Protocol""ImPS/2" Option"Buttons""5" Option"ZAxisMapping""4 5" EndSection
Then save the file, save any stuff in the applications you have open and log out. From the Kubuntu login screen, either do Ctrl+Alt+Backspace to restart the X Server and for the settings to apply, or click the little menu button and select the “Restart X Server” option as shown in the screenshot below. The menu option you need to click has a black arrow pointing at it in the screenshot below.
After the X Server has restarted, the login screen will appear again so log in and the scroll wheel on your mouse should now work.
VMWare Server 1.0 doesn’t support the same set of features as the more recent versions of VMWare Workstation and VMWare
Just over a year I posted how to install VMWare Tools on a Linux Guest Virtual Machine which specifically looks at installing VMWare Tools for Red Hat / CentOS. I recently set up a Debian 5 Lenny virtual machine using VMWare Server and installed the VMWare Tools and the process is fairly similar but I had a couple of issues due to it being a base install with no compiler so thought it a good idea to post how to install VMWare Tools on a Debian 5 Virtual Machine.
After I unwittingly upgraded from openSUSE 10.2 to openSUSE 10.3, I wasn’t able to configure VMWare Workstation 6.0 on openSUSE 10.3 so ended up downloading the updated 6.0.1 version of VMWare Workstation. This fixed my issue with being able to configure it and run my guest operating systems but changing from the 2.6.18 kernel to 2.6.22 appears to have introduced another issue.
Note: I have found the solution to the issue. Refer to the 04 October Update below for more details.
I print directly onto CDs and DVDs using a Canon Pixma ip4300 printer when producing Linux CDs for my Linux CD Mall website. There are printer drivers available from Turboprint for Linux for this particular printer but I’ve found it’s easier to simply connect the printer to the Windows XP guest and use the drivers in Windows instead of in the Linux host. The CD printing software also only runs on Windows so I need to run that in the guest operating system anyway.
After getting VMWare running again, I went to print a CD label and discovered the printer wasn’t connected. This isn’t unusal because I’ve often found after not using the guest for a few hours the USB connection seems to somehow become disconnected. All I need to do to connect the printer back to the guest is to select VM -> Removable Devices -> USB Devices from the Vmware Workstation file menu and then select the printer.
I went to do this but there was nothing listed under the USB Devices submenu; it just said “empty”. I verified the printer was actually connected to the computer, and checked the Linux system log to see that it was registering the device.
The output from the system log when I pulled the USB cable out of the computer was as follows:
Sep 20 11:19:10 desktop kernel: usb 2-7.3: USB disconnect, address 13
And the output when I plugged it back in again was as follows:
Sep 20 11:19:15 desktop kernel: usb 2-7.3: new high speed USB device using ehci_hcd and address 15
Sep 20 11:19:15 desktop kernel: usb 2-7.3: new device found, idVendor=04a9, idProduct=10b6
Sep 20 11:19:15 desktop kernel: usb 2-7.3: new device strings: Mfr=1, Product=2, SerialNumber=3
Sep 20 11:19:15 desktop kernel: usb 2-7.3: Product: iP4300
Sep 20 11:19:15 desktop kernel: usb 2-7.3: Manufacturer: Canon
Sep 20 11:19:15 desktop kernel: usb 2-7.3: SerialNumber: 9128CC
Sep 20 11:19:15 desktop kernel: usb 2-7.3: configuration #1 chosen from 1 choice
Sep 20 11:19:15 desktop kernel: drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 15 if 0 alt 0 proto 2 vid 0x04A9 pid 0x10B6
So all looking good there. But the Removable Devices -> USB Devices was still showing “empty”.
I did a fair bit of searching on the Internet and couldn’t find any resolution, although it does appear that the location of USB devices may have changed between openSUSE 10.2 and 10.3, kernels 2.6.18 and 2.6.22 which may be causing the issue: VMWare isn’t sure where to pick the information up from.
Not quite sure what to do next, I thought maybe I should try plugging in another USB device and see if it can detect that. So I pulled out a USB memory stick, unplugged the printer and plugged in the memory stick. Nope, still didn’t detect it. The USB connection I plug my printer into is on the monitor, so I wondered if plugging the USB stick into one of the ports on the front of the computer might make a difference. I plugged the printer back in, and then plugged the stick into one of the front ports.
When I checked Removable Devices -> USB Devices again there was no memory stick, but to my surprise the printer was now there… I’ve messed around with this a little, and as long as I have the focus on the virtual machine, have some other USB device also attached, unplug the printer, leave the cable out for a few seconds and then plug it back in again, I seem to be able to connect the printer to the guest, although sometimes it takes a couple of goes. Hopefully this issue will be fixed in later revisions of VMWare Workstation, or in kernel updates.
Update 28 September 2007
I did an update today which updated the kernel from 126.96.36.199-18-default to 188.8.131.52-29-default and it seems to have fixed this issue, ie I no longer seem to have issues connecting the printer to the virtual machine.
Update 01 October 2007
Hmm maybe not, it’s still completely random about whether it works or not. Sometimes I have to plug, unplug, plug, unplug devices etc etc to get it to see any USB devices. And sometimes I can only get it to work with a reboot of the guest operating system. What a pain.
Update 04 October 2007
I found this page in the VMWare knowledge base which talks about the issue and the solution. It appears to come down to some Linux distros (such as openSUSE which I am currently using) not mounting the usb filesystem at /proc/bus/usb automatically.
The line in the /etc/fstab file which deals with this is as follows:
usbfs/proc/bus/usbusbfsnoauto 0 0
Changing it to the following will fix the issue out on reboot:
usbfs/proc/bus/usbusbfsauto 0 0
To fix the issue without rebooting (although you still need to modify /etc/fstab so it still works on restart) you need to mount the usbfs like so, either as root or using sudo:
The knowledge base post says to do this
mount -t usbfs none /proc/bus/usb but it didn’t seem to work for me, so I umounted it and then did as in the block above. I also shut down all guest operating systems and restarted the VMWare Workstation client. Once it started up again I was able to access all the connected USB devices.
After I unwittingly upgraded from openSUSE 10.2 to openSUSE 10.3 last week, the Linux kernel upgraded from 184.108.40.206-34 to 220.127.116.11-18. I run VMWare Workstation on this desktop machine, and each time the kernel is updated VMWare must be reconfigured and the kernel modules recompiled.
I was running VMWare Workstation 6.0.0-45731, but when I tried to run
vmware-config.pl I got the following error messages:
Would you like to skip networking setup and keep your old settings as they are?
Extracting the sources of the vmnet module.
Building the vmnet module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config1/vmnet-only'
make -C /lib/modules/18.104.22.168-18-default/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make: Entering directory `/usr/src/linux-22.214.171.124-18-obj/x86_64/default'
make -C ../../../linux-126.96.36.199-18 O=../linux-188.8.131.52-18-obj/x86_64/default modules
/tmp/vmware-config1/vmnet-only/userif.c: In function ‘VNetCopyDatagramToUser’:
/tmp/vmware-config1/vmnet-only/userif.c:630: error: ‘const struct sk_buff’ has no member named ‘h’
/tmp/vmware-config1/vmnet-only/userif.c:630: error: ‘const struct sk_buff’ has no member named ‘nh’
/tmp/vmware-config1/vmnet-only/userif.c:636: error: ‘const struct sk_buff’ has no member named ‘h’
make: *** [/tmp/vmware-config1/vmnet-only/userif.o] Error 1
make: *** [_module_/tmp/vmware-config1/vmnet-only] Error 2
make: *** [modules] Error 2
make: *** [modules] Error 2
make: Leaving directory `/usr/src/linux-184.108.40.206-18-obj/x86_64/default'
make: *** [vmnet.ko] Error 2
make: Leaving directory `/tmp/vmware-config1/vmnet-only'
Unable to build the vmnet module.
For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
I was a bit mystified about what to do, and doing some searches on Google didn’t really turn up anything useful. A quick look at the VMWare website showed there was an updated version of VMWare Workstation available (6.0.1-55017), so I downloaded that and installed it.
I was then able to run
vmware-config.pl with no issues. I guess there were some issues with the newer kernel that the older version of VMWare Workstation wasn’t able to deal with, but which had been addressed in the newer version of Workstation.
I use VMWare Workstation 6.0 for testing out various Linux distributions either to run live CDs or install a full operating system without having to have a dedicated computer for that specific purpose only.
While playing around with a Linux distribution in VMWare Workstation the other day, I realised I needed to drop to the console, log in as root and do something from the command line. So I hit Ctrl+Alt+F1 expecting this to do it in the virtual machine, but it instead dropped my host operating system to the command line console. Not quite what I was expecting, but as I quickly remembered, Ctrl+Alt has special meaning in VMWare Workstation as a way of releasing keyboard and mouse control from the guest and returning it to the host.