vmware / open-vm-tools

Official repository of VMware open-vm-tools project
http://sourceforge.net/projects/open-vm-tools/
2.26k stars 427 forks source link

Can you explain how to start on sysv init based systems? #150

Open Meai1 opened 7 years ago

Meai1 commented 7 years ago

For example, the readme only says:

The ResolutionSet plugin to adjust guest screen resolutions automatically based on window sizes.

Ok but what do I need to start to make this work? Same with copy+paste.

I tried starting vmtoolsd, but it doesnt seem to do anything. Not sure, copy paste or resize doesnt work while it's running. I tried starting the vmghfs-fuse binary but it said: Error -107: cannot open connection. I dont know what to do. I want copy+paste/resolutionSet and shared folders to work.

oliverkurth commented 7 years ago

In desktop VMs (that is VMs that have a graphical UI installed), there should be two vmtoolsd processes running. One is for the system and does for example power oerations. It runs as root. You can start it with the command:

/usr/bin/vmtoolsd -b or /usr/local/bin/vmtoolsd -b /var/run/vmtoolsd.pid , if you built from source with default options.

The '-b' option makes it runs as a daemon, ideal for init scripts (not for systemd and upstart).

For copy/paste, dnd and resolutionSet there should be another process running with the "-n vmusr" option. This runs with the user's privileges. Ideally, this is started automatically when the user logs into the GUI. You can start it manually with

vmware-user-suid-wrapper

Or to start it automatically, add a file /etc/xdg/autostart/vmware-user.desktop with this content:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Exec=/usr/bin/vmware-user-suid-wrapper
Name=VMware User Agent
X-KDE-autostart-phase=1

For the vmhgfs error: please make sure that you have sharing enabled for that VM in WS or Fusion, and have selected a folder to share.

Meai1 commented 7 years ago

When I try vmware-user-suid-wrapper it says: "vmware-user: could not open /proc/fs/vmblock/dev"

oliverkurth commented 7 years ago

You need the fuse mount for vmblock as well (sorry for not mentioning that earlier). Also, the vmware-user-suid-wrapper needs the suid bit set. You can use these steps:

#!/bin/bash

echo "mounting vmblock-fuse"
sudo modprobe fuse
sudo mkdir -p /var/run/vmblock-fuse
sudo /usr/local/bin/vmware-vmblock-fuse -o subtype=vmware-vmblock,default_permissions,allow_other /var/run/vmblock-fuse

echo "starting vmtoolsd"
sudo /usr/local/bin/vmtoolsd --background /var/run/vmtoolsd.pid

echo "setting suid bit for vmware-user-suid-wrapper"
sudo chmod u+s /usr/local/bin/vmware-user-suid-wrapper

echo "starting vmusr process"
/usr/local/bin/vmware-user-suid-wrapper

To share folders, make sure you have sharing enables in WS/Fusion, and follow the steps as outlined by @lousybrit at https://github.com/vmware/open-vm-tools/issues/147#issuecomment-285737514 .

ellieayla commented 6 years ago

I observe that /var/run/vmblock-fuse doesn't exist on Kali 2017.3 (i386). vmtoolsd is running, and the suid bit is in-place for vmware-user-suid-wrapper. But without the directory, vmware-vmblock-fuse won't mount. And /var/run is a symlink to /run, which is a tmpfs ramdisk. I don't see anything that creates this directory during boot. Steps from @oliverkurth above work.

jjaone commented 6 years ago

Thanks @oliverkurth for your advice. I got the copy-and-paste working in VMware14/Win7 host running Linux/Ubuntu16.04 guest OS but I always have to run vmware-user-suid-wrapper script manually after login to my system. Eventually I added to my $HOME/.profilefile this:

# VMware: ensure that copy/paste and drag/drop are working
# - this should be run from xdg/desktop settings but it doesn't happen in this guest :(
[[ -x /usr/bin/vmware-user-suid-wrapper ]] && /usr/bin/vmware-user-suid-wrapper

to make it run automatically after login and while the X/lightdm is starting.

I was just wondering what could be the reason for the /etc/xdg/autostart/vmware-user.desktopnot working. I have that file excatly with that content that you posted in the above comment, but still it doesn't work. It might be caused by how the VMware14 in Win7/host boots my Linux guest, but am not sure.

kupietools commented 11 months ago

This is ridiculous. Five years later, I still can't find a single working solution that allows me to paste into a VMware machine. I'm trying to configure a server and I have to type huge code blocks by hand. It's asking for errors and misconfigurations. There needs to be a working implementation of copy/paste between host and guest or this system is not usable for any serious purpose.

ghost-ng commented 8 months ago

lol i still have the same problem - i find myself here searching for the mythical copy/paste solution that randomly stops in vmware workstation