Category Archives: Virtualization

VMware ESX : Failed to connect ethernet0

You may encounter this error on VMware ESX / ESXi server on a guest event console (on vSphere Client) :

Error message from host.domain.tld: Failed to connect ethernet0

Of course, the guest system have no functional network.

This probably happen if you actually rename a Virtual Network that was previously used by the guest. Changes does not apply automatically on guests.

To solve this, simply do :

- Go to Summary tab > Click on Edit settings
- Click on Network adapter 1 > and select the proper Network label inside the Network connection section.

VMware : Install ESX tools for RHEL / CentOS Linux using YUM

To install VMware Tools from the ESX repository on RedHat/CentOS Linux guests using YUM, you need first to install the public key :

rpm –import http://packages.vmware.com/tools/VMWARE-PACKAGING-GPG-KEY.pub

Now, you need to create the repository file located in /etc/yum.repos.d :

vi /etc/yum.repos.d/vmware-tools.repo

And then, paste the following :

[vmware-tools]
name=VMware Tools for Red Hat Enterprise Linux $releasever – $basearch
baseurl=http://packages.vmware.com/tools/esx/<esx-version>/rhel<X>/<arch>
enabled=1
gpgcheck=1

At this point, you need to modify some stuff contain within < > according your needs :

<esx-version> = Your current ESX Server version where guests are running (such as 5.0p02 or 5.0)
<X> = Your guest OS version (such as rhel5 or rhel6)
<arch> = Your guest architecture (such as x86_64 or i386)

Hint : you may have a look at http://packages.vmware.com/tools/esx/ with your browser to discover folder names.

Okay, now let’s install VMware Tools :

yum install vmware-tools-services

OpenVZ : Unable to set capacity on running container

Got this error trying to adjust time on a VPS from the host node?

[root@server ~]# vzctl set 111 –capability sys_timen –save
Unable to set capability on running container
WARNING: Some of the parameters could not be applied to a running container.
Please consider using –setmode option

There is two possible solutions :

1. Stop the VPS and use the following command and start the VPS :

vzctl set 111 –capability sys_timen –save

2. Use this command and the the parameter will be enabled next time the VPS will be rebooted :

vzctl set 111 –capability sys_timen –setmode restart –save

* Be careful with option 2 – VPS reboot itself in some occasion using this command!

VMware Workstation : VMware Tools installation cannot be started manually while the easy install is in progress

This error occur when the virtual floppy auto install did not unmounted properly.

Simply do the following :

1. Shutdown the virtual machine
2. Disconnect the virtual floppy drive or set the drive to use the system floppy instead of image
3. Then, boot you’re guest and try again to install VMware Tools

If theses steps doesn’t work, you may need to delete and add again the virtual floppy device. Of course, you may delete forever the device if you don’t need it!

VMware Server : PAM unable to dlopen pam_unix2.so

Using VMware Server on RedHat Enterprise Linux, you may expect this error in log file /var/log/secure :

PAM unable to dlopen(/lib/security/pam_unix2.so
PAM [error: /lib/security/pam_unix2.so: cannot open shared object file: No such file or directory]
PAM adding faulty module: /lib/security/pam_unix2.so

Actually, this error does not seem to affect the functionality of VMware Server. To work around this situation and get rid of this error, let’s create a symbolic link like this :

ln -s /lib/security/pam_unix.so /lib/security/pam_unix2.so

(must be done as root – or sudo)

VMware Server : Performance tweak tips

VMware Server performance can be improved in so many ways… there are some recomendation that I’ve discovered when I was using this product at large before moving them to ESXi :

  • Use preallocated virtual disk
  • Use as less virtual hardware as possible – do not add unneeded hardware
  • Use ext4 or XFS filesystem (if host run under Linux – be careful with XFS, does not react so well with power outage!)
  • Use fast enough hardware (depending on your usage – have as more ram you can afford and avoid host and guests to swap!)

Avoid unused memory to be reallocated to the host, this consume a lot of CPU power.  Since VMware Server 2, this option has been removed from the GUI. You need to add the following parameter in the virtual machine config file (.vmx)

MemTrimRate = “0″

Set the following filesystem attribute (edit /etc/fstab) to save on disk I/O (on host as well on guests) :

noatime

Example : LABEL=/     /     ext4     defaults,noatime     1 1

Use the following kernel parameters for linux guests (the first parameter is to solve the known time synchronization problem) :

divider=10 noapic nolapic

Do NOT add a second virtual CPU if you are running VM on a single socket machine. Multiple core CPU does not count… enable this only if your motherboard have two physical CPU.

In such case, and you probably running a modern Linux distribution with a stock kernel, you should disable the SMP function… just add the following kernel parameter (/boot/grub/grub.conf) :

nosmp

VMware : convert a growable to preallocated virtual disk

VMware allow four type of virtual disk (vmdk) :

0 : single growable virtual disk
1 : growable virtual disk split in 2Gb files
2 : single preallocated virtual disk
3 : preallocated virtual disk split in 2Gb files

command : vmware-vdiskmanager -r <source-disk> -t <type> <target-disk>

Now, if you want to convert your growable disk into preallocated disk, you may use the following command in a terminal :

vmware-vdiskmanager -r current_disk_name.vmdk -t 3 new_disk_name.vmdk

Linux : Remove VMware Workstation

Latest VMware Workstation (such as VMware-Workstation-Full-7.1.4-385536.x86_64.bundle) can be uninstalled using the following command on a Linux host :

vmware-installer -u vmware-workstation

You may have a look at the list of VMware product installed and their version using this command :

vmware-installer -l

Mac Parallels Desktop : How to right click on Windows

To right click on Windows object on Parallels Desktop with Mac OSX coherence mode, just press the following key : SHIFT + CONTROL + Click on the object.

VMware : Mac OSX guest crash or failed to start

Considering that you have a supported CPU with VT enabled, you may have a look at the guest configuration file (.vmx) and make sure theses value are correct :

guestOS = “darwin-64″
ich7m.present = “TRUE”
smc.present = “FALSE”
keyboard.vusb.enable = “TRUE”
mouse.vusb.enable = “TRUE”
monitor.virtual_exec = “hardware”
monitor.virtual_mmu = “software”