{{Article summary wiki|Moving an existing install into (or out of) a virtual machine}}

{{Article summary end}}

{{Article summary end}}

Line 29:

Line 30:

'''3.''' Read & accept the EULA to continue.

'''3.''' Read & accept the EULA to continue.

−

'''4.''' Set {{Ic|System service scripts directory}} to {{ic|/etc/rc.d}}.

+

'''4.''' Set {{Ic|System service scripts directory}} to {{ic|/etc/init.d}}.

'''5.''' (Optional) If Eclipse is installed, enter the directory path to the Integrated Virtual Debugger.

'''5.''' (Optional) If Eclipse is installed, enter the directory path to the Integrated Virtual Debugger.

'''6.''' You will now get an error about the {{ic|"rc*.d style init script directories"}} not being set. This can, however, be safely ignored.

'''6.''' You will now get an error about the {{ic|"rc*.d style init script directories"}} not being set. This can, however, be safely ignored.

−

−

'''7.''' Create links for the daemons:

−

# ln -s /etc/init.d/vmware /etc/rc.d/

−

# ln -s /etc/init.d/vmware-workstation-server /etc/rc.d/

==Configuration==

==Configuration==

{{Tip|There is also a package called {{AUR|vmware-patch}} in the [[Arch User Repository|AUR]] with the intention of trying to automate this section (it also supports older VMware versions).}}

{{Tip|There is also a package called {{AUR|vmware-patch}} in the [[Arch User Repository|AUR]] with the intention of trying to automate this section (it also supports older VMware versions).}}

+

+

{{Note|Ensure you have installed the correct headers required for building the modules ({{pkg|linux}} from {{ic|[core]}} uses {{pkg|linux-headers}}).}}

===Module tool paths===

===Module tool paths===

−

{{Note|As of {{Pkg|kmod}} 5-2 the locations of {{ic|lsmod}}, {{ic|modinfo}}, etc. have changed from {{ic|/bin/}} to {{ic|/usr/bin/}}.}}

+

'''7.''' The {{ic|module tool paths}} of certain Workstation scripts now need to be pointed to {{ic|/usr/bin/}} instead of {{ic|/sbin/}}. These include the service script in {{ic|/etc/init.d/}} and some other ones in {{ic|/usr/bin/}}.

−

'''8.''' The {{ic|module tool paths}} of certain Workstation scripts now need to be pointed to {{ic|/usr/bin/}} instead of {{ic|/sbin/}}. These include the service script in {{ic|/etc/init.d/}} and some other ones in {{ic|/usr/bin/}}:

+

====1) A short-term solution====

+

A short-term solution consists of editing the files directly. You will need to redo this upon every update.

# for i in {ins,ls,rm}mod modinfo; do ln -s /usr/bin/$i /sbin/$i; done

# for i in {ins,ls,rm}mod modinfo; do ln -s /usr/bin/$i /sbin/$i; done

===VMware module patches and installation===

===VMware module patches and installation===

−

VMware Workstation 9 and Player 5 both support kernels up to 3.5.

+

Both VMware Workstation 9 and Player 5 support kernels up to 3.7. However, the required header {{ic|version.h}} was [http://lkml.org/lkml/2012/10/14/281 relocated] since 3.7 and needs to be [http://rglinuxtech.com/2012/11/18/vmware-9-0-1-not-so-clever-after-all/ symlinked]. The following patches will also install the modules afterwards by executing {{ic|vmware-modconfig --console --install-all}}.

+

{{Note|Due to different VMware versions, you may need to set the {{ic|vmreqver}} or {{ic|plreqver}} variable for VMware Workstation or Player respectively in the {{ic|patch-modules_3.X.0.sh}} script.}}

+

+

====3.7 kernels and up====

+

With the arrival of 3.7 the directory structure of the uapi sources (and thus the headers) has changed. The missing kernel header {{ic|version.h}} can be symlinked with:

You can replace "'''{{ic|$(uname -r)}}'''" with any kernel not currently running.

+

{{Note|You will need to redo this upon every major kernel update.}}

−

====3.5 / 3.6rc kernels====

+

====3.8 kernels====

−

A change in the format of the kernel exception table introduced back in [http://repo.or.cz/w/linux-2.6.git/commit/706276543b699d80f546e45f8b12574e7b18d952 April] affecting the {{ic|vmmon}} module is known to cause crashes in [http://communities.vmware.com/thread/400616 Fedora guests]. The patch [http://communities.vmware.com/message/2092356#2092356 here] creates a portable exception table (packaged together with the script [http://communities.vmware.com/message/2103172#2103172 in here]) and will also install the modules afterwards by executing {{ic|# vmware-modconfig --console --install-all}} (this will also reload the {{ic|vmmon}} module):

+

In addition to the header symlink outlined above 3.8 kernels also need [http://communities.vmware.com/thread/432897 this] (packaged together with the script in [https://github.com/willysr/SlackHacks/tree/master/vmware/vmware-3.8 here]):

A change in the format of the kernel exception table introduced back in [http://repo.or.cz/w/linux-2.6.git/commit/706276543b699d80f546e45f8b12574e7b18d952 April] affecting the {{ic|vmmon}} module is known to cause crashes in [http://communities.vmware.com/thread/400616 Fedora guests]. The patch [http://communities.vmware.com/message/2092356#2092356 here] creates a portable exception table (packaged together with the script [http://communities.vmware.com/message/2103172#2103172 in here], which will also reload the {{ic|vmmon}} module):

$ cd /tmp

$ cd /tmp

Line 71:

Line 90:

==Finishing up==

==Finishing up==

−

'''9.''' (Optional) Add {{Ic|vmwared}} to the [[Daemons|DAEMONS]] array in {{ic|/etc/[[rc.conf]]}} so that the service is started automatically on boot.

+

'''8.''' (Optional) Instead of using {{ic|<nowiki># /etc/init.d/vmware {start|stop|status|restart}</nowiki>}} directly to manage the services you may also create a {{ic|.service}} file (or [http://communities.vmware.com/docs/DOC-20855 files]):

+

+

{{hc|/etc/systemd/system/vmware.service|

+

2=[Unit]

+

Description=VMware daemon

+

[Service]

+

ExecStart=/etc/init.d/vmware start

+

ExecStop=/etc/init.d/vmware stop

+

PIDFile=/var/lock/subsys/vmware

+

TimeoutSec=0

+

RemainAfterExit=yes

+

[Install]

+

WantedBy=multi-user.target

+

}}

+

+

To start the {{ic|.service}} on boot:

+

# systemctl enable vmware

−

'''10.''' Now, open your VMware Workstation ({{Ic|vmware}} in the console) or VMware Player ({{Ic|vmplayer}} in the console) to configure & use!

+

'''9.''' Now, open your VMware Workstation ({{Ic|vmware}} in the console) or VMware Player ({{Ic|vmplayer}} in the console) to configure & use!

{{Warning|When upgrading the kernel you '''will''' have to rebuild the VMware modules with the following command:

{{Warning|When upgrading the kernel you '''will''' have to rebuild the VMware modules with the following command:

CoW comes with some advantages, but can negatively affect performance with large files that have small random writes. It is recomended to disable CoW for database files and virtual machine images. To disable CoW for the whole file system it should be mounted with the {{ic|nodatacow}} flag. To disable CoW for single files/directories:

+

+

$ chattr +C [file/directory path]

+

+

{{Note|1=From the [http://www.linuxhowtos.org/manpages/1/chattr.htm?print=-51 chattr man page]: ''"For btrfs, the {{ic|C}} flag should be set only on new or empty files. If set on a file which already has data blocks, it is undefined when the blocks assigned to the file will be fully stable. If set on a directory, only new files will be affected."''}}

===Using DKMS to manage the modules===

===Using DKMS to manage the modules===

−

The Dynamic Kernel Module Support (DKMS) can be used to manage Workstation modules and to void from re-running {{ic|vmware-modconfig}} each time the kernel changes. The following example uses a custom {{ic|Makefile}} that compiles the modules with {{ic|vmware-modconfig}}. Afterwards they are removed from the current kernel tree.

+

The Dynamic Kernel Module Support (DKMS) can be used to manage Workstation modules and to void from re-running {{ic|vmware-modconfig}} each time the kernel changes. The following example uses a custom {{ic|Makefile}} to compile and install the modules through {{ic|vmware-modconfig}}. Afterwards they are removed from the current kernel tree.

+

====Preparation====

First install {{pkg|dkms}} from the [[Community repository]]:

First install {{pkg|dkms}} from the [[Community repository]]:

# pacman -S dkms

# pacman -S dkms

−

then create a source directory for the {{ic|Makefile}} and the DKMS config file.

+

then create a source directory for the {{ic|Makefile}} and the {{ic|dkms.conf}}.

−

# mkdir /usr/src/vmware-modules

+

# mkdir /usr/src/vmware-modules-9

−

then the {{ic|dkms.conf}} that describes the module names, the compilation and the installation. {{ic|1=AUTOINSTALL="yes"}} tells the modules to be recompiled/installed automatically each time:

If everything went well, the modules will now be recompiled automatically the next time the kernel changes.

If everything went well, the modules will now be recompiled automatically the next time the kernel changes.

−

== Troubleshooting ==

+

==Troubleshooting==

−

=== Could not open /dev/vmmon: No such file or directory. ===

+

===Could not open /dev/vmmon: No such file or directory.===

The full error is:

The full error is:

Could not open /dev/vmmon: No such file or directory.

Could not open /dev/vmmon: No such file or directory.

Please make sure that the kernel module `vmmon' is loaded.

Please make sure that the kernel module `vmmon' is loaded.

−

This means that at least the {{Ic|vmmon}} VMware service is not running. All VMware services can be started with:

+

This means that at least the {{Ic|vmmon}} VMware service is not running. If using the {{ic|.service}} file from step 8. all VMware services can be started with:

−

# rc.d start vmware

+

# systemctl start vmware

−

+

−

On [[Systemd|systemd]] only systems ({{ic|rc.d}} is owned by {{Pkg|initscripts}}) you need to create a separate {{ic|.service}} file:

+

−

+

−

{{hc|/etc/systemd/system/vmware.service|

+

−

2=[Unit]

+

−

Description=VMware daemon

+

−

[Service]

+

−

ExecStart=/etc/rc.d/vmware start

+

−

ExecStop=/etc/rc.d/vmware stop

+

−

PIDFile=/var/lock/subsys/vmware

+

−

TimeoutSec=0

+

−

RemainAfterExit=yes

+

−

[Install]

+

−

WantedBy=multi-user.target

+

−

}}

+

−

then start the service with:

+

otherwise use:

−

# systemctl start vmware.service

+

# /etc/init.d/vmware start

−

=== Kernel headers for version 3.x-xxxx were not found. If you installed them[...] ===

+

===Kernel headers for version 3.x-xxxx were not found. If you installed them[...]===

Install them with:

Install them with:

# pacman -S linux-headers

# pacman -S linux-headers

Line 242:

Line 255:

{{Note|Upgrading the kernel and the headers will require you to boot to the new kernel to match the version of the headers. This is a relatively common error.}}

{{Note|Upgrading the kernel and the headers will require you to boot to the new kernel to match the version of the headers. This is a relatively common error.}}

−

=== USB devices not recognized ===

+

===USB devices not recognized===

+

====1) The {{ic|vmware-USBArbitrator}} script is missing====

For some reason, some installations are missing the {{ic|vmware-USBArbitrator}} script. To readd it manually see [https://bbs.archlinux.org/viewtopic.php?pid=1003117#p1003117 this forum post].

For some reason, some installations are missing the {{ic|vmware-USBArbitrator}} script. To readd it manually see [https://bbs.archlinux.org/viewtopic.php?pid=1003117#p1003117 this forum post].

−

You may also manually extract the VMware bundle and copy the {{ic|vmware-USBArbitrator}} script from {{ic|<destination folder>/vmware-usbarbitrator/etc/init.d/}} to {{ic|/etc/rc.d/}} (which seems to be its default installation folder instead of {{ic|/etc/init.d/}}):

+

You may also manually extract the VMware bundle and copy the {{ic|vmware-USBArbitrator}} script from {{ic|<destination folder>/vmware-usbarbitrator/etc/init.d/}} to {{ic|/etc/init.d/}}:

This could also mean that the {{ic|vmware-usbarbitrator}} binary called in the script is [https://bbs.archlinux.org/viewtopic.php?pid=1156789 segfaulting]:

This could also mean that the {{ic|vmware-usbarbitrator}} binary called in the script is [https://bbs.archlinux.org/viewtopic.php?pid=1156789 segfaulting]:

{{hc|# vmware-usbarbitrator --info -f|

{{hc|# vmware-usbarbitrator --info -f|

Line 257:

Line 272:

This is caused by an empty {{ic|/etc/arch-release}} (owned by {{pkg|filesystem}}). It is used by the service to alter its behavior based on the distribution's release version.

This is caused by an empty {{ic|/etc/arch-release}} (owned by {{pkg|filesystem}}). It is used by the service to alter its behavior based on the distribution's release version.

−

To fix it, add a version string in the form of {{ic|<year>.<month>(.<day>)}} (e.g. {{ic|[https://www.archlinux.org/news/new-install-medium-20120907/ 2012.09.07]}}).

+

To fix it, add a version string in the form of {{ic|<year>.<month>(.<day>)}} (e.g. {{ic|[https://www.archlinux.org/news/december-time-for-a-new-install-medium/ 2012.12.01]}}).

−

=== process XXXX: Attempt to remove filter function[...] ===

+

===process XXXX: Attempt to remove filter function[...]===

The full error is, for example:

The full error is, for example:

process 6094: Attempt to remove filter function 0xadcc96f0 user data 0xb795aba0, but no such filter has been added

process 6094: Attempt to remove filter function 0xadcc96f0 user data 0xb795aba0, but no such filter has been added

Line 268:

Line 283:

# hald

# hald

−

=== The installer fails to start ===

+

===The installer fails to start===

If you just get back to the prompt when opening the {{ic|.bundle}}, then you probably have a deprecated or broken version of the VMware installer and you should remove it (you may also refer to the [[#Uninstallation|uninstallation]] section of this article):

If you just get back to the prompt when opening the {{ic|.bundle}}, then you probably have a deprecated or broken version of the VMware installer and you should remove it (you may also refer to the [[#Uninstallation|uninstallation]] section of this article):

VMware Workstation 9 provides the possibility to remotely manage Shared VMs through the {{ic|vmware-workstation-server}} service. However, this will fail with the error {{ic|"incorrect username/password"}} due to incorrect PAM configuration of the {{ic|vmware-authd}} service. To fix it, edit {{ic|/etc/pam.d/vmware-authd}} like this:

VMware Workstation 9 provides the possibility to remotely manage Shared VMs through the {{ic|vmware-workstation-server}} service. However, this will fail with the error {{ic|"incorrect username/password"}} due to incorrect PAM configuration of the {{ic|vmware-authd}} service. To fix it, edit {{ic|/etc/pam.d/vmware-authd}} like this:

Line 284:

Line 299:

and restart VMware services with:

and restart VMware services with:

−

# rc.d restart vmware vmware-workstation-server

+

# systemctl restart vmware

Now you can connect to the server with the credentials provided during the installation.

Now you can connect to the server with the credentials provided during the installation.

Line 290:

Line 305:

{{Note|{{Pkg|libxslt}} may be required for starting virtual machines.}}

{{Note|{{Pkg|libxslt}} may be required for starting virtual machines.}}

−

=== Issues with ALSA output ===

+

===Issues with ALSA output===

The following instructions from [http://bankimbhavsar.blogspot.co.nz/2011/09/hd-audio-in-vmware-fusion-4-and-vmware.html Bankim Bhavsar's wiki] show how to manually adjust the [[ALSA]] output device in a VMware {{ic|.vmx}} file. This might help with quality issues or with enabling proper HD audio output:

The following instructions from [http://bankimbhavsar.blogspot.co.nz/2011/09/hd-audio-in-vmware-fusion-4-and-vmware.html Bankim Bhavsar's wiki] show how to manually adjust the [[ALSA]] output device in a VMware {{ic|.vmx}} file. This might help with quality issues or with enabling proper HD audio output:

Line 309:

Line 324:

# vmware-installer -u <vmware-product>

# vmware-installer -u <vmware-product>

−

Manually included symlinks have to be removed manually in {{ic|/etc/rc.d/}} and {{ic|/sbin/}}:

+

Manually included symlinks have to be removed manually in {{ic|/sbin/}}:

2) A long-term solution

You could also just create symlinks with:

# for i in {ins,ls,rm}mod modinfo; do ln -s /usr/bin/$i /sbin/$i; done

VMware module patches and installation

Both VMware Workstation 9 and Player 5 support kernels up to 3.7. However, the required header version.h was relocated since 3.7 and needs to be symlinked. The following patches will also install the modules afterwards by executing vmware-modconfig --console --install-all.

Note: Due to different VMware versions, you may need to set the vmreqver or plreqver variable for VMware Workstation or Player respectively in the patch-modules_3.X.0.sh script.

3.7 kernels and up

With the arrival of 3.7 the directory structure of the uapi sources (and thus the headers) has changed. The missing kernel header version.h can be symlinked with:

3.5 / 3.6 kernels

Note: Required only for VMWare Workstation 9.0.0 and Player 5.0.0

A change in the format of the kernel exception table introduced back in April affecting the vmmon module is known to cause crashes in Fedora guests. The patch here creates a portable exception table (packaged together with the script in here, which will also reload the vmmon module):

Using the modified BIOS

If and when you decide to modify the extracted BIOS you can make your virtual machine use it by moving it to ~/vmware/<Virtual machine name>:

$ mv bios440.rom ~/vmware/<Virtual machine name>/

then adding the name to the <Virtual machine name>.vmx file:

~/vmware/<Virtual machine name>/<Virtual machine name>.vmx

bios440.filename = "bios440.rom"

Copy-On-Write (CoW)

CoW comes with some advantages, but can negatively affect performance with large files that have small random writes. It is recomended to disable CoW for database files and virtual machine images. To disable CoW for the whole file system it should be mounted with the nodatacow flag. To disable CoW for single files/directories:

$ chattr +C [file/directory path]

Note: From the chattr man page: "For btrfs, the C flag should be set only on new or empty files. If set on a file which already has data blocks, it is undefined when the blocks assigned to the file will be fully stable. If set on a directory, only new files will be affected."

Using DKMS to manage the modules

The Dynamic Kernel Module Support (DKMS) can be used to manage Workstation modules and to void from re-running vmware-modconfig each time the kernel changes. The following example uses a custom Makefile to compile and install the modules through vmware-modconfig. Afterwards they are removed from the current kernel tree.

2) The vmware-usbarbitrator binary is segfaulting

This could also mean that the vmware-usbarbitrator binary called in the script is segfaulting:

# vmware-usbarbitrator --info -f

VTHREAD initialize main thread 2 "usbArb" pid 6426
Segmentation fault

This is caused by an empty /etc/arch-release (owned by filesystem). It is used by the service to alter its behavior based on the distribution's release version.

To fix it, add a version string in the form of <year>.<month>(.<day>) (e.g. 2012.12.01).

process XXXX: Attempt to remove filter function[...]

The full error is, for example:

process 6094: Attempt to remove filter function 0xadcc96f0 user data 0xb795aba0, but no such filter has been added
D-Bus not built with -rdynamic so unable to print a backtrace
Aborted

This means that the hal daemon is not running. Install halAUR from the AUR and start the daemon with:

# hald

The installer fails to start

If you just get back to the prompt when opening the .bundle, then you probably have a deprecated or broken version of the VMware installer and you should remove it (you may also refer to the uninstallation section of this article):

# rm -r /etc/vmware-installer

Incorrect login/password when trying to access VMware remotely

VMware Workstation 9 provides the possibility to remotely manage Shared VMs through the vmware-workstation-server service. However, this will fail with the error "incorrect username/password" due to incorrect PAM configuration of the vmware-authd service. To fix it, edit /etc/pam.d/vmware-authd like this:

Issues with ALSA output

The following instructions from Bankim Bhavsar's wiki show how to manually adjust the ALSA output device in a VMware .vmx file. This might help with quality issues or with enabling proper HD audio output:

Suspend/Power off the VM.

Run aplay -L

If you are interested in playing 5.1 surround sound from the guest, look for surround51:CARD=vendor-name,DEV=num. If you are experiencing quality issues, look out for a line starting with front.

Open the <Virtual machine name>.vmx config file of the VM in a text editor, located under ~/vmware/<Virtual machine name>/, and edit the sound.fileName field, e.g.: sound.fileName="surround51:CARD=Live,DEV=0". Ensure that it also reads sound.autodetect="FALSE".

Resume/Power on the VM.

Uninstallation

To uninstall VMware you need the product name (either vmware-workstation or vmware-player). To list all the installed products: