Tag Archives: vmware

VMware modules, Arch Linux & kernel 4.8.13

After upgrading the kernel to 4.8.13-1-ARCH some of the vmware kernel modules failed to compile:

/tmp/modconfig-6BT70S/vmmon-only/linux/hostif.c:1592:47: error: ‘NR_ANON_PAGES’ undeclared (first use in this function)
/tmp/modconfig-BBuLH6/vmnet-only/netif.c:468:7: error: ‘struct net_device’ has no member named ‘trans_start’; did you mean ‘mem_start’?

The fix:

[codesyntax lang="bash"]

cd /usr/lib/vmware/modules/source
tar xf vmnet.tar
tar xf vmmon.tar
mv vmnet.tar vmnet.old.tar
mv vmmon.tar vmmon.old.tar
sed -i -e 's/dev->trans_start = jiffies/netif_trans_update(dev)/g' vmnet-only/netif.c
sed -i -e 's/unsigned int anonPages = global_page_state(NR_ANON_PAGES);/unsigned int anonPages = global_page_state(NR_ANON_MAPPED);/g' vmmon-only/hostif.c
tar cf vmnet.tar vmnet-only
tar cf vmmon.tar vmmon-only
rm -r vmnet-only
rm -r vmmon-only

vmware-modconfig --console --install-all

[/codesyntax]

VMware modules, Ubuntu 14.04 & kernel 3.13

After many years of using Debian, I decided to give Ubuntu 14.04 a shoot... One of the many problems I have encountered was the installation of VMware. Well, everything went fine but the kernel modules... Ok, long story short, here's the patch:

[codesyntax lang="bash"]

vim ~/vmnet313.patch

[/codesyntax]

205a206
> #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
206a208,210
> #else
> VNetFilterHookFn(const struct nf_hook_ops *ops,        // IN:
> #endif
255c259,263
<    transmit = (hooknum == VMW_NF_INET_POST_ROUTING);
---
>    #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
>       transmit = (hooknum == VMW_NF_INET_POST_ROUTING);
>    #else
>       transmit = (ops->hooknum == VMW_NF_INET_POST_ROUTING);
>    #endif

[codesyntax lang="bash"]

:wq

[/codesyntax]

[codesyntax lang="bash"]

# Change directory into the vmware module source directory
cd /usr/lib/vmware/modules/source
# untar the vmnet modules
tar -xvf vmnet.tar
# run a the patch you should have just saved earlier
patch vmnet-only/filter.c < ~/vmnet313.patch
# re-tar the modules
tar -uvf vmnet.tar vmnet-only
# delete the previous working directory
rm -r vmnet-only
# just run the GUI app
vmware

[/codesyntax]

There you go!

How to convert a vmware linux virtual machine to xenserver virtual machine

As the title of this documents says, this document describes how to convert a vmware virtual machine to xenserver virtual machine. Although so far this procedure hasn't fail, please use this procedure on your own risk.

1. Install quemu on the vmware Server or another Linux machine (on debian based distribution use apt-get install qemu-utils, on centos use yum install qemu)

2. Uninstall vmware modules on the vmware guest you wish to convert

3. Stop the vmware guest

4. Check the format of the vmdk file:

qemu-img info guest22-flat.vmdk
image: fooguest22-flat.vmdk
file format: raw
virtual size: 15G
disk size: 15G

5. If the file format is "raw", we need not convert the image file using qemu-img convert, just rename to .img file. If it is not "raw", use "qemu-img" to convert the image to raw format.

6. Convert the file with qemu-img
[codesyntax lang="bash"]

qemu-img convert guest22-flat.vmdk -O raw /volumes/guest22/guest22.img

[/codesyntax]

7. Copy the image file to the xen server with scp or rsync
[codesyntax lang="bash"]

rsync -avz --stats --progress --partial /volumes/guest22/guest22.img root@xenserver:~/

[/codesyntax]

8. Create a guest with at least the same disk size and amount of RAM as the imported vmware virtual disk. Rename the disk under properties so you can locate it later (your_disk_name).
9. Open a console or connect to the xen server with ssh and find the disk copy the uuid of the host

[codesyntax lang="bash"]

xe vdi-list name-label=your_disk_name

[/codesyntax]

uuid ( RO)                : 565c8fcf-5a52-4f05-8fd0-de943b99fa12
          name-label ( RW): your_disk_name
    name-description ( RW): your_disk_name description
             sr-uuid ( RO): 81c5bb77-8fe5-628e-f407-73b07b7054cd
        virtual-size ( RO): 8589934592
            sharable ( RO): false
           read-only ( RO): false

10. Import the image (use the uuid from the step 9)
[codesyntax lang="bash"]

xe vdi-import uuid=565c8fcf-5a52-4f05-8fd0-de943b99fa12 filename=guest22.img

[/codesyntax]

11. Fire up your converted xen image. You may have to modify the grub boot loader vmware uses /dev/sda for it’s HD and xen uses /dev/hda.

12. If you machine does not boot press e at the grub prompt an search for root=/dev/sda1 line and change it to root=/dev/hda1 please change this in you grub.conf once the machine has booted and save your changes

Note: if your vmware guest has multiple 2G vmdk files you need to merge all of them into one single file. Please consult the page: https://sysadmin.compxtreme.ro/vmware-how-do-you-merge-multiple-2gb-disk-files-to-single-vmdk-file/

What to do when "VMware Infrastructure Web Access" stuck to "Loading..."

This document describes what do you need to do when page of VMware Infrastructure Web Access stuck to Loading... and nothing appears in your browser.

1. Edit /etc/vmware/webAccess/proxy.properties
[codesyntax lang="bash"]

vim /etc/vmware/webAccess/proxy.properties
:%s/proxy.noCache = false/proxy.noCache = true
:wq

[/codesyntax]

2. Restart the vmware-mgmt service:
[codesyntax lang="bash"]

/etc/init.d/vmware-mgmt restart

[/codesyntax]

Vmware: How do you merge multiple 2GB disk files to single vmdk file

In case of the 2GB split disk format, your virtual disk consists of multiple data files (e.g. <vmname>-sNNN.vmdk) and one header/descriptor file (<vmname>.vmdk) which describes the virtual disk. In the vmware-vdiskmanager command, it's only the header/descriptor vmdk which you need to supply as the source virtual disk.

Convert to a pre-allocated disk.
[codesyntax lang="bash"]

vmware-vdiskmanager -r sourceDisk.vmdk -t 2 destinationDisk.vmdk

[/codesyntax]

The following line is simply changing a pre-allocated input disk into a growable target disk.
[codesyntax lang="bash"]

vmware-vdiskmanager -r sourceDisk.vmdk -t 0 destinationDisk.vmdk

[/codesyntax]