Showing posts with label VMWare Player. Show all posts
Showing posts with label VMWare Player. 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, 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?

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, 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.

Monday, December 9, 2013

VMWare Tools Failed to Load on Ubuntu 13.10 (Saucy)

I am running a Ubuntu guest OS using VMWare Player. I upgraded my guest Ubuntu to Ubuntu 13.10 through "do-release-upgrade" and upgraded my VMWare player to 6.01. When I was upgrading the VMWare Tools, I encountered a problem that the VMWare Tools cannot be loaded. I did a quite a few web searches and many suggested to disable the vmware-tools-thinprint service. On my guest, it did not help by disabling the vmware-tools-thinprint service. What actually helped was to upgrade vmxnet to vmxnet3, which can be accomplished by directly editing the virtual machine's configuration file. To edit the configuration file, in my case the Ubuntu.vmx file, add a line to the file, e.g.,


ethernet0.virtualDev = "vmxnet3"


The solution was hinted by the error message when I ran vmware-install.pl,


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)

In some case, as indicated by the comment below, you may also need to uninstall (by running vmware-uninstall-tools.pl that should have been installed, by default at the /usr/bin directory) and reinstall VMWare tools.

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.