Showing posts with label VMWare. Show all posts
Showing posts with label VMWare. Show all posts

Sunday, May 17, 2020

Failed to Start Virtual Machine in VMWare Workstation Player

I upgraded VMWare Workstation Player to 15.5.2 on a Windows 10 host. It failed to start any virtual machines after the upgrade. The error message is

VMware Player and Device/Credential Guard are not compatible. VMware
Player can be run after disabling Device/Credential Guard. Please visit
http://www.vmware.com/go/turnoff_CG_Dg for more details. 
 

I followed the instruction to make sure that the Device Guide was disabled. Since I have a Windows Pro, to disable Device Guard, I run the Local Group Policy Editor

mmc gpedit.msc


However, the problem remains. It turned out an additional step was need, that was to run the following command as the system adiministrator and reboot the Windows host,

bcdedit /set hypervisorlaunchtype off 

Tuesday, March 6, 2018

Old Bug in open-vm-tools and Git Commit Problem.

There is a known bug in open-vm-tools that can interference with a number of applications when we operate on a vmhgfs-fuse file system. This bug is documented as issue #90, and there are a few other discussion about this, in particular, a discussion on how to install recent release of open-vm-tools on Ubuntu 16.04 LTS since Ubuntu 16.04 LTS at this moment still ships open-vm-tools version 10.0.7 that carries this bug.

You may check your open-vm-tools version with one of many methods, such as,

vmware-toolbox-cmd -v

or

apt-show-versions open-vm-tools

If the output indicates that you have a version of earlier than 10.1.0, your version of open-vm-tools may have this bug. It causes serious problems in a few rather frequently used applications. In my case, when I use do a git commit, I would observe the following,

$ git commit -m "done something trivial"
error: bad index file sha1 signature
fatal: index file corrupt

After 5 seconds, when I try it again, the git commit is successful. As discussed in issue #90, this is the result that the tools cache file attributes and entries and causes a cache inconsistency. The 5-second delay is the waiting time before the cached items get updated.

Some also observed that this bug causes the npm install to fail.

Perhaps, the more important issue is how we may address this issue before the Linux distributors have a new version of the tools for us to upgrade to. Suggested in the discussions cited is to use a Ubuntu test PPA repository since it does not appear to be problem-free to build the tools from the source. The steps to install from the test PPA are as follows,


sudo add-apt-repository ppa:ci-train-ppa-service/3152
sudo apt-get update
sudo apt-get upgrade open-vm-tools open-vm-tools-desktop open-vm-tools-dkms

In my case, these steps lead to the successful installation of the open-vm-tools version 10.2.0.1608 (build-7253323), and it seems to work fine although some seem to observe some issues, such as, a race condition.

Tuesday, April 18, 2017

Heavy Disk Activity after Suspending a VMWare Virtual Machine Instance

I observed heavy disk activity when I suspended a VMware virtual machine instance. The VMware software is VMware Player 7.1.4 and the virtual machine instance is a Windows XP instance. The disk activity is so heavy that it almost renders the host machine non-responsive for a quite while. After some research online, I found these configuration options to be helpful,

mainMem.useNamedFile = "false"
mainMem.writeZeroes = "true"


You can apply these two configuration options in two different manners.
  • Apply them to a specific virtual machine instance by adding these two lines to the virtual machine configuration file, i.e., a .vmx file.
  • Apply them as the global and default options for all virtual machine instances by adding these two lines to VMware software's configuration file. For VMWare Player, it is %PROGRAMDATA%\VMWare\VMware Player\config.ini. If the file does not exist, you should create it. For other versions of VMware software, see this VMware KnowledgeBase article.

To understand why and how these may address the heavy disk activity issue and whether you should use these options, the following are a few excellent references that I came across in my research.
  1. VMware Workstation and Very High VMEM Fragmentation
  2. Maximize VMWare images performance
  3. Write Activity to .vmem file even though the VM is suspended
  4. Why does my PC slow down to a crawl when VMware Player is suspending to .vmem file?

Monday, November 7, 2016

VMWare Unity Mode on Ubuntu 16.04 LTS

Some users want to run Linux desktop guests  "seamlessly" within host operating systems, for which, VMWare Hypervisors  provides a functionality called VMware "Unity" mode.

This post is about how we can enable the Unity mode on Linux desktop guests running Ubuntu 16.04,  well, if you are willing to settle on an older version of WMware Workstation or Player.

In fact,  it becomes difficult to enable the "Unity" mode for Linux guests. If you visit my older post on enabling VMware Unity mode on Ubuntu 14.04, you can see many have encountered difficulties, myself included.  In particular, it is getting more difficult to enable the Unity mode on recent releases of desktop editions of Linux distributions. In my opinion, the difficulties come form the following three sources,

  • Apparently, VMWare has recently dropped the support of Unity mode for Linux guests. You can infer this by comparing the documentation of VMware Workstation Player 12 with that of the previous version of the player, the VMware Player 7. VMware's Workstation Player 12 documentation now states,
    "
    Use Unity Mode
    You can switch virtual machines that have Windows XP or later guest operating systems to Unity mode to display applications directly on the host system desktop.
    "
    On the contrary, VMware Player 7 documentation states,
    "
    Use Unity Mode
    You can switch virtual machines that have Linux or Windows 2000 or later guest operating systems to Unity mode to display applications directly on the host system desktop.
    "
    It is clearly that Linux support has been dropped.

  • Unity mode requires MetaCity or KDE,  which does not appear to be the default and optimization objective for major Linux distributions.

  • VMWare Unity mode's installation software does not know how to interact with systemd that has gradually becomes the default choice of the init service on most Linux distributions.

However, having observed the above, we actually have a solution.
  • Hypervisor. We need to stick to the version of VMware Workstation or Player that supports the Unity mode. The newest version of Player that supports the Unity mode is actually VMWare Player 7.1.4. You can download it from VMware

  • Linux Guest Dekstop  Environment. We need to stick to Gnome 2 MetaCity or KDE. 

For Ubuntu 16.04, we can enable Unity mode using VMware Player  by following the steps below,
  • Download and install VMware Player 7.1.4. Note that neither any version older than 7.1.4 nor any version newer than VMware Player, such as VMware Workstation 12 will work.

  • In Ubuntu 16.04, install Gnome Flashback as follows,
    
    sudo apt-get install gnome-flashback gnome-session-flashback
    

  • From the menu of VMware Player, choose "Player", "Manage", and "Install VMware Tools" (or Reinstall VMware Tools"). Make sure that you are installing VMwareTools 9.9.5. Earlier version would crash the vmtools library at the Ubuntu guest when you attempt to switch to Unity mode.

  • In the Ubuntu Linux guest, extract the mounted VMwareTools image, and run "vmware-install.pl" to install the VMware Tools.

  • Upon successfully installation of the VMware Tools, log out.
  • When you log in, on the screen of the Display Manager, make sure that you select "GNOME Flashback (Metacity)" as shown below.


  • Upon log in, you should be able to switch to the VMware Unity mode.


Friday, September 4, 2015

VMWare Tools Installer Complaining About Ethernet Driver on Linux Guests

When installing the VMWare Tools on Linux Guests, we sometimes see that the installer of the VMWare Tools complains about Ethernet drivers,

The vmxnet driver is no longer supported on kernels 3.3 and greater. Please
upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)

which does not necessarily mean that the Ethernet drivers are not vmxnet3 or e1000e. My experience indicates that it sometimes complains about the Ethernet driver's not being vmxnet3 or e1000e even if the driver is one of the two.

First, we can determine what Ethernet driver is loaded by using lspci command on the Linux virtual machine as follows,

lspci |  grep "Ethernet controller"

As the example below, if the output indicates that the Ethernet driver is vmxnet3 or e1000e, we can safely ignore the complain.

$ lspci |  grep "Ethernet controller"
03:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)

However, if the Ethernet driver is not one of the two, it is better to change the virtual Ethernet driver to be one of the two. VMWare has a Knowledge Base article on how to manually configure Ethernet adapter for a virtual machine. Following the article, we can configure the Ethernet driver in the steps below,

  1. Power off the virtual machine
  2. Locate and open the virtual machine configuration file (.vmx) for editing on the host
  3. Look for Ethernet configuration, by searching "ethernet" in the configuration file
  4. If you find a configuration entry as follows,
    
          ethernet0.virtualDev = "vmxnet"
          
    or
    
          ethernet0.virtualDev = "e1000"
          
    you should replace "vmxnet" or "e1000" by "vmxnet3" or "e1000e".

    Be aware that the above shows an example for the first Ethernet adapter, i.e., "ethernet0". If you have multiple Ethernet adapters, you should repeat the above steps for all Ethernet adapters.

    If you do not find a configuration entry as such, you need to add the entry to the configuration file, i.e.,
    
          ethernet0.virtualDev = "vmxnet3"
          
    or
    
          ethernet0.virtualDev = "e1000e"
          
    Repeat the step all Ethernet adapters.
  5. Save the configuration file and reboot the Linux guest
  6. Use lspci on the Linux guest to confirm that desired Ethernet driver is loaded.

You may wonder among "vmxnet3" or "e1000e", which one you should choose. According to this article, it appears that the better choice is "vmxnet3".

Friday, August 7, 2015

Configuring VMWare Player Virtual Networks

When we use VMWare Player to run guest operating systems, we sometimes want to automatically configure guest operating systems, such as, to assign fixed IP addresses to guest operating systems based on guest systems' network interfaces' MAC addresses.

This post discusses two items,
  1. to assign fixed IP address to interfaces of guest systems via VMWare's DHCP server
  2. and to change virtual subnet setting for virtual Ethernet segments using the vmnetcfg tool

Assigning Fixed IP Address


VMWare Player comes with a DHCP server that allows the guest systems to automatically configure their IP network settings. By configuring the DHCP server, we can achieve the auto-configuration purpose.

On Windows hosts, the configuration file of the DHCP server is located at directory %ProgramData%\VMWare. As an example, I show the value of  %ProgramData%\VMWare below,



C:>echo %ProgramData%\VMWare
C:\ProgramData\VMWare



In the directory is the configuration file, i.e., vmnetdhcp.conf. We can add host entries to the configuration file to assign fixed IP addresses to guest operating systems. Below is an example that assigns IP address 192.168.101.127 to MAC address 00:0c:29:22:12:4c in the virtual Ethernet segment 8.



# Virtual ethernet segment 8
# Added at 08/06/15 10:57:08
subnet 192.168.101.0 netmask 255.255.255.0 {
range 192.168.101.128 192.168.101.254;            # default allows up to 125 VM's
option broadcast-address 192.168.101.255;
option domain-name-servers 192.168.101.2;
option domain-name "localdomain";
option netbios-name-servers 192.168.101.2;
option routers 192.168.101.2;
default-lease-time 1800;
max-lease-time 7200;
}
host VMnet8 {
    hardware ethernet 00:50:56:10:00:01;
    fixed-address 192.168.101.1;
    option domain-name-servers 0.0.0.0;
    option domain-name "";
    option routers 0.0.0.0;
}

host Ubuntu {
    hardware ethernet 00:0c:29:22:12:4c;
    fixed-address 192.168.101.127;
    option domain-name-servers 192.168.101.2;
    option domain-name "";
    option routers 192.168.101.2;
} 


Changing Virtual Subnet Setting

One particular problem I often encounter is that the IP subnet setting is always changed when I upgrade or reinstall VMWare Player. For instance, in the above IP assignment example, the virtual Ethernet segment 8 is assigned a subnet of 192.168.101.0 with net mask 255.255.255.0 (i.e., 192.168.101.0/24); however, when I reinstall VMWare Player, the Ethernet segment 8's subnet assignment may become 192.168.157.0 with net mask 255.255.255.0 or some other value.

A simple method to change the Ethernet segment's subnet assignment back to the original value or any other valid value is to use the vmnetcfg tool.

The vmnetcfg tool is a part of VMWare Workstation; however, it does not come with VMWare Player. Since we can download VMWare Workstation trial version from VMWare's website, we can extract the tool from the installation package and use it with VMWare Player.

Two excellent posts that helped me and detail how one may extract the vmnetcfg tool from VMWare Workstation installation package and how one may use the tool to reassign a subnet to a virtual Ethernet segment are,

  1. Download vmnetcfg.exe & vmnetcfglib.dll for VMware Player 6.x & 7.x
  2. VMWare Interfaces Tutorial
For the impatient, the user interface of the vmnetcfg tool looks as follows,



It is obvious that one can change the subnet assignment to a selected virtual Ethernet segment.

Tuesday, February 24, 2015

Creating Small Footprint Linux Virtual Machine - Revisited

Although many virtual machine appliances exist today and are conveniently to download, such as the VMWare Virtual Appliance Marketplace and the TurnKey Linux Virtual Appliance Library, it may be necessary to create a virtual machine image of your own and distribute it among the others. The issue is that a virtual machine image can easily become a monster and can be difficult to host, upload, download, and distribute such a large image. Previously, I attempted to create Linux virtual machine images with small footprint using the approach of installing the system and removing unnecessary packages. That approach leads to virtual machine images compressible to around 1GB archives.

Lately, I have opted to a second approach in which we install a bare bone Linux system and then install necessary packages. This approach, I found, often leads to smaller footprint than the previous approach.

The only caveat is that this approach may not work well with certain Linux distributions if the Linux distribution does not provide a means to install bare bone systems. If a Linux distribution does not provide a means to install the bare bone systems, it is likely to be a desktop edition, for instance, Ubuntu Linux's Desktop Edition has no option for a user to install a bare bone system during its installation process. A workaround is to create the system image using its corresponding server edition distribution, for instance, Ubuntu Linux's Server Edition allows you to install a bare bone system.

At present, I have a 64-bit Ubuntu Linux Server Edition image with PostGreSQL, Apache Web Server, and PHP but without GUI and the image is compressed to about 350MB archive.


Thursday, September 18, 2014

Creating Small Footprint Linux Virtual Machine

Although it may be easier to download a Linux virtual appliance, it can be fun to create linux virtual machines yourself. In particular, we may be interested in creating small footprint Linux virtual machines -- it would be easy to put it on a USB drive or let other people to download it. This post documents the process that I use to create Ubuntu 14.04 (Trusty) Linux virtual machines and reduce the image size of the virtual machines. The key idea is (1) to remove non-essential packages as much as possible; (2) to increase the compression of virtual machine images by zeroing virtual disks; and (3) to compact and compress the virtual machine image.
  1. Download 32-bit Ubuntu 14.04 (Trusty) ISO file and install it as a guest operating system under VMware Player or VirtualBox.  
  2. To make copy & paste instructions easier, install VMware Tools.  
    1. Install Linux headers and the build essential packages

      sudo apt-get install linux-headers-generic build-essential

    2. Then install VMware Tools
    3. Restart the virtual machine.
  3. By default, Ubuntu 14.04 runs the Ubuntu Unity desktop environment. It prevents us from entering the VMware Unity mode. I now get rid of the Ubuntu Unity desktop environment. I learned the command from this post.
    
    sudo apt-get purge \
         unity unity-common unity-services \
         unity-lens-\* unity-scope-\* unity-webapps-\* \
         gnome-control-center-unity \
         hud libunity-core-6\* libunity-misc4 \
         libunity-webapps\* appmenu-gtk \
         appmenu-gtk3 appmenu-qt\* overlay-scrollbar\* \
         activity-log-manager-control-center \
         firefox-globalmenu thunderbird-globalmenu \
         libufe-xidgetter0 xul-ext-unity \
         xul-ext-webaccounts webaccounts-extension-common \
         xul-ext-websites-integration \
         gnome-control-center gnome-session

  4. Then, install GNOME 3.
    
    sudo apt-get install gnome-session-fallback
    

  5. Now, remove the default games.
    
    sudo apt-get game\* purge ace-of-penguins gnome-mahjongg gnome-mines \
                 berusky biniax2 gnurobbo groundhog gtkballs hitori \
                 four-in-a-row gnect gbrainy gnome-sudoku chess\* \
                 nibbles\* solitaire\* iagno\* klotski\* tetravex\* \
                 drascula gtkboard oneisenough openyahtzee ri-li \
                 scribble swell-foop quadrapassel\* lightsoff \
                 five-or-more gnome-robots gtali
    

  6. Remove a few network applications.
    
    sudo apt-get purge webbrowser-app thunderbird\*
    

  7. Remove Libre Office. This can save a few hundred megabytes.
    
    sudo apt-get purge libreoffice\*
    

  8. Now get rid of the "Ubuntu Software Center".
    
    sudo apt-get purge software-center\*
    

  9. The /var/cache directory can easily have a few hundred megabytes data. We can trim it down.
    
    sudo apt-get clean
    

  10. Do an automove,
    
    sudo apt-get autoremove
    

  11. Now remove GNOME and Ubuntu documentation.
    
      sudo apt-get purge yelp\*
      

  12. Now, you can install whatever important software you want to include in the virtual machine, e.g., I am installing Octave,

    
    sudo apt-get install octave
    

  13. We would probably want to compress the virtual machine image before we pass it to someone. We need to replace every byte of free space on the disk by 0's.
    
    dd if=/dev/zero of=zerofile; \
       sleep 5; sync; \
       sleep 5; sync; \
       sleep 5; sync; \
       rm -f zerofile;
    

  14. I am using VMware Player. Using it, I do a "defragment" and then "compact" the virtual disk. The guest system must be off before you can do it. Of course, you can do the same using VirtualBox.
  15. Finally, I compress the folder of the virtual machine. The zip archieve file is about 1 GB. 
In addition, you may save a few megabytes, by removing all log and temporary files. The tool bleachbit can help. Before you zero the hard disk, install and run the tool.


sudo apt-get install bleachbit; sudo bleachbit

Sunday, September 7, 2014

Ubuntu 14.04 (Trusty) and VMWare Unity Mode

Unity mode is a nice feature of VMWare's virtualization software. However, you will find that you cannot switch to VMWare Unity mode once you install the most recent release of Ubuntu including Ubuntu 14.04 (Trusty) and its predecessor (Ubuntu 13.10 or Saucy).

It turns out that VMWare does not like Ubuntu's default desktop environment called Ubuntu Unity. It could be confusing that the Ubuntu Unity desktop environment and the VMWare Unity mode share the same word "Unity", and it has created a difficulty  for us who try to find an answer  on the web since depending on what search terms you enter, web searches can give you answers related to both and it becomes a diffcult task to find a solution that may help you.

Since VMWare cannot switch to Unity mode is a result that VMWare does not like Ubuntu's default desktop environment called Ubuntu Unity, the solution becomes to find a Desktop Environment that VMWare can work with.

On Ubuntu 13.10 (Saucy), I found that Gnome 3 works with the VMWare Unity mode. Therefore, the solution is to install Gnome 3 and to use Gnome 3. To install Gnome 3, you may issue command below,
sudo apt-get update; sudo apt-get install gnome-session-fallback

I have been happily running Ubuntu 13.10 (Sauncy) as a guest operating system and using it in VMWare Unity mode for a quite while, well, until I upgrade it to Ubuntu 14.04 (Trusty). What is the problem? I checked the versions of Gnome 3 before and after the upgrade from Ubuntu 13.10 (Sauncy) to Ubuntu 14.04 (Trusty), they are the same,

$ gnome-session --version
gnome-session 3.9.90

I believe that it is still the issue with the Desktop environment that Ubuntu is running -- not VMWare tries not to support such a feature. Then, the task is to find out which desktop environment works with the VMWare Unity mode on Ubuntu 14.04 (Trusty). I found the list of Desktop environments that I may try from this post, 
I did not try all of them. However, I am happily to report that the following Desktop environments that work with VMWare Unity mode on Ubuntu 14.04 (Trusty),

  • Xfce
    To install it. Run
          sudo apt-get install xfce4
      
    or if you want more bells & whitsles, 
          apt-get install xubuntu-desktop
          
  • LXDE
    To install it. Run
          sudo apt-get install lxde
      
    or if you want the full desktop environment,
          apt-get install lubuntu-desktop
          
  • Mate
    To install it. Run
    sudo apt-add-repository ppa:ubuntu-mate-dev/ppa
    sudo apt-add-repository ppa:ubuntu-mate-dev/trusty-mate
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install --no-install-recommends \
                        ubuntu-mate-core ubuntu-mate-desktop
    
    At this point, you can switch to VMware Unity mode. However, the application menu of the VMWare Unity mode is empty. This is the result that the VMware tools at present only recognoizes three desktop environments, Gnome, KDE, and Xfce -- if you run vmware-xdg-detect-de in your Ubuntu guest, you will see that the output of the script is empty. I made one minor change to the script,  and the VMWare Unity mode menu appeared. Below is the diff result on the script before and after the revision.
    diff \
      /usr/bin/vmware-xdg-detect-de \
      $HOME/vmware-tools-distrib/lib/bin32/vmware-xdg-detect-de
    63,67d62
    <   elif `dbus-send --print-reply --dest=org.freedesktop.DBus \
    <       /org/freedesktop/DBus \
    <       org.freedesktop.DBus.GetNameOwner \
    <       string:org.mate.SessionManager > /dev/null 2>&1` ; \
    <       then DE=gnome; # pretent to be gnome
    

    The complete script is at GitHub.
  • GNOME Flashback/Fallback

    As described before, to install it, run,
    sudo apt-get update; sudo apt-get install gnome-session-fallback
        
    Initially, I thought GNOME Flashback/Fallback stopped working with VMware Unity mode on Ubuntu 14.04. However, once I investigated further, I discovered that Ubuntu 14.04 reports the value of environmental variable XDG_CURRENT_DESKTOP as Unity. The solution is still to let vmware-xdg-detect-de return gnome. What I did is shown in this diff result,
    diff /usr/bin/vmware-xdg-detect-de \
         $HOME/vmware-tools-distrib/lib/bin32/vmware-xdg-detect-de
    58,60d57
    < DE=gnome
    < xdgDE=gnome
    

    The complete script using the approach described above (although not identical) is at GitHub. It is worth noting that when I manually set the environmental variable to GNOME in the user profile, e.g., adding the following line to $HOME/.profile, VMware Unity mode remains NOT working. 
    export XDG_CURRENT_DESKTOP=GNOME
    
    It begins to work only after I made the revision to vmware-xdg-detect-de as described above.

    A new problem I have encountered is that once VMware enters the Unity mode, in some of my Ubuntu virtual machines, the application menu is empty -- if you always launch programs from command line, it may not be too much of a problem. A further investigation indicates that this problem only occurs on the Ubuntu virtual machines that are upgraded from previous revision. I reinstalled the gnome-session-flashback and the problem went away. To reinstall the package, do,
    
    sudo apt-get install --reinstall gnome-session-flashback
    

    Just be aware that when you have GNOME Flashback/Fallback installed, you will have two options on the login screen, "GNOME Flashback (compwiz)" and "GNOME Flashback (metacity)". VMware Unity mode only works with the latter. In fact, VMware lists "a modern version of Metacity or KDE" as a prerequist to use the Unity mode on its website.

To conclude, below is what I have tried.


Testing Result of Desktop Environment for VMWare Unity Mode on Ubuntu 14.04 (Trusty)
Desktop EnvironmentDisplay Name in Login ScreenVMWare Unity Mode Works?
Ubuntu UnityUbuntu DefaultNo
GNOME 3GNOMENo
GNOME 3GNOME Flashback (Compwiz)No
GNOME 3GNOME Flashback (Metacity)Yes (See the note on Gnome above and
download vmware-xdg-detect-de)
XfceXfceYes
XfceXUbuntuYes
LXDELXDEYes
LXDELUbuntuYes
MateMateYes (See the note on Mate above and
download vmware-xdg-detect-de)
AwesomeAwesomeNo

However, if you try a different desktop envionment on Ubuntu 14.04 (Trusty) and it works or does not work with the VMWare Unity mode, please share it with me. I will update this post to include your result.


Tuesday, July 22, 2014

After Kernel Upgrade VMware Ubuntu Guest Hang During Boot

I am running a Ubuntu Saucy (13.04) guest and later a Ubuntu Trusty (14.04) guest using VMWare Player on Windows 8.1. What has troubled me is that the guest hangs every single time after the POST screen is shown during boot after I upgraded the kernel. I have to press "Ctrl-Alt-Del" to restart, enter "Advanced Option" from the Ubuntu boot menu and choose an old kernel to boot. I finally figured out how to solve the problem.  The hint of the solution came from my examining the VM log file. The location of the VM log file is on the VMware Player's "About VMware Player" window. From VMWare Player, you can open the window by clicking on the "Player" menu, next "Help", and then "About VMware Player". Below is an example of the "About VMware Player" window.

 

In the above example, the VM log file is at C:\Users\...\Ubuntu\vmware.log. When the Ubuntu is hangs, at the end of the VM log file, I saw some log messages similar to the below,

2014-07-22T19:21:19.299-04:00| vmx| I120: GuestRpcSendTimedOut: 
                                          message to toolbox timed out.
2014-07-22T19:21:19.299-04:00| vmx| I120: Vix: [5648 guestCommands.c:1924]: 
                                          Error VIX_E_TOOLS_NOT_RUNNING in 
VMAutomationTranslateGuestRpcError(): VMware Tools are not running in the guest
2014-07-22T19:21:25.635-04:00| vmx| I120: USBGW: Write arbitrator op:13 len:11

My guess is that the VMware Tools is not installed and configured properly for the new Linux kernel. The solution would to reinstall the VMware Tools. Since the Ubuntu guest hangs during boot, I have to find an alternate to do it. Luckily, I can boot the Ubuntu guest into the "Recovery Mode" with the problematic Linux kernel via the "Advanced Option" during boot. 

I observed two difficulties when I tried to reinstall the VMware Tools in the "Recovery Mode".
  1. When I tried to install the VMware Tools when I switched to shell in the "Recovery Mode" by running <code>sudo ./vmware-install.pl</code>, I observed many warning messages similar to below,
    
    The /tmp directory may be under attack
    


  2. You may have to download the VMware Tools, for which, we need to enable network in the "Recovery Mode". 

To address the above difficulties, my solutions is,

  1. In the "Recovery Mode", first enable "network" from the list of options.
  2. Then go to shell (by choosing "Drop to root shell  prompt").
  3. Start the sshd. This is a two-step procedure.

    
    mkdir /var/run/sshd
    /usr/sbin/sshd
    
    
  4. Now, figure out the IP address of the guest (e.g., using ifconfig)
  5. Log onto the virtual machine using a Secure Shell client as a regular user with sudo privilege.
  6. Install the VMware player as the regular user using sudo.
  7. Reboot. The the problem went away.

Sunday, September 29, 2013

Convert VirtualBox VDI to VMWare VMDK

You can run virtual machine instances created in one virtualization software in another. QEMU is a good tool to do this. The following example converts a VirtualBox VDI file to a VMDK file that can be loaded in VMWare.

I did the conversion on a Windows host. You can download the precompiled Windows binaries of QEMU, provided by Prashant Satish,  or those provided by Eric Lassauge.

The procedure is the same in Linux hosts.

  1. To convert VirtualBox virtual appliance to a VMDK file.
    qemu-img convert  virtualbox.vdi  -O vmdk vmware.vmdk
  2. If you have VMWare Workstation or more luxury version, you can start with creating a new virtual machine. During the process, you have the option of selecting an "existing disk". In this case, you simply select the .vmdk file.

    However, I would like to stick to the free VMWare Player that does not provide the option of selecting an "existing disk". I have to use a workaround.

    Start VMWare Player, then create a new virtual machine, for instance, a virtual machine called "vboxvmware".  You must select "I will install the operating system later." option as the two images show. 



    Since you created or downloaded the VirtualBox virtual machine, you should know what guest operating system it is and what memory capacity is allocated. Choose them accordingly.



    Next step, choose the option of "Store Virtual Disk as a Single File".


    Upon confirming your choice, you will see that the virtual machine is created.



    The last step is to edit the VMWare virtual machine configuration file (.vmx file). Go to the directory where the virtual machine is located, locate the .vmx file, and edit the file using your favorite text editor. In the editor, locate the line of "scsi0:0.fileName = ..." and replace the virtual disk file by the .vmdk file previously converted using QEMU. Note that when you edit the file, make sure the path of the .vmdk file is correct if it is not copied to the directory. Then, you can safely remove the vboxvwmare.vmdk file that your virtual machine does not really use. You can then safely launch the virtual machine from the summary screen.