WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: open-vm-tools: error on shares mapping  (Read 5480 times)

SeventhSin

  • Guest
open-vm-tools: error on shares mapping
« on: July 02, 2019, 02:03:07 PM »
Hello all,

Currently testing with TinyCorePure64 in a VM deployed in VMwareWorkstation, but the same behavior has been observed on x86. I have enabled "Shared Folders" in the VM's configuration and created a test share, named vm-share. During boot (pre-X), the following message shows-up briefly:

Code: [Select]
fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf
Post-X, a new folder pops-up: /mnt/hgfs-vm-shared/. However it is empty, since nothing gets mounted.

Code: [Select]
tc@box:/$ tree /mnt/hgfs-vm-shared/
/mnt/hgfs-vm-shared/

0 directories, 0 files

Running vmhgfs-fuse manually leads to the desired behavior:

Code: [Select]
tc@box:/$ mkdir -p /mnt/hgfs/ && vmhgfs-fuse /mnt/hgfs
tc@box:/$ tree /mnt/hgfs
/mnt/hgfs
`-- vm-shared
    `-- New\ folder

2 directories, 0 files

Of course there is no /etc/fuse.conf.

Offline andyj

  • Hero Member
  • *****
  • Posts: 1022
Re: open-vm-tools: error on shares mapping
« Reply #1 on: July 02, 2019, 04:10:02 PM »
/etc/fuse.conf is created when the vmtoolsd service is started. Add this to /opt/bootsync.sh or /opt/bootlocal.sh:

Code: [Select]
/usr/local/etc/init.d/open-vm-tools start

SeventhSin

  • Guest
Re: open-vm-tools: error on shares mapping
« Reply #2 on: July 03, 2019, 03:52:56 AM »
/etc/fuse.conf is created when the vmtoolsd service is started. Add this to /opt/bootsync.sh or /opt/bootlocal.sh:

Code: [Select]
/usr/local/etc/init.d/open-vm-tools start

That solved it, thank you andyj !

Just a quick question: wouldn't it be more... "elegant" to have a root folder, say /mnt/hgfs and all the shared folders mounted under that instead of "polluting" (subjective choice of words) the /mnt with one entry per shared folder?

What do you guys think?

Offline andyj

  • Hero Member
  • *****
  • Posts: 1022
Re: open-vm-tools: error on shares mapping
« Reply #3 on: July 03, 2019, 04:49:36 AM »
Shared folders are mounted in /etc/profile.d//etc/profile.d/open-vm-tools.sh when you log in. It would be a one-character change so it shouldn't be a big deal for the next version, whenever that is. Since I only have one shared folder it's not an issue for me. In theory they should be unmounted when you log out, but if ash supports a logout script I don't know what it is. Someone would have to look through the source and see. As always, suggestions and patches to open-vm-tools are welcome.

SeventhSin

  • Guest
Re: open-vm-tools: error on shares mapping
« Reply #4 on: July 03, 2019, 06:21:52 AM »
@andyj

I also noticed that the Services option in the ControlPanel app doesn't show open-vm-tools service as started although there is a
Code: [Select]
/usr/local/etc/init.d/open-vm-tools start entry in /opt/bootlocal.sh.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: open-vm-tools: error on shares mapping
« Reply #5 on: July 03, 2019, 06:44:13 AM »
Hi SeventhSin
Try entering  services  at the command line and see if any errors are printed out.

SeventhSin

  • Guest
Re: open-vm-tools: error on shares mapping
« Reply #6 on: July 03, 2019, 06:52:40 AM »
Hi SeventhSin
Try entering  services  at the command line and see if any errors are printed out.

Hi Rich.

Code: [Select]
tc@tc-pure-10:~$ services
Found total 6 services.

Then the app's GUI gets displayed.

SeventhSin

  • Guest
Re: open-vm-tools: error on shares mapping
« Reply #7 on: July 03, 2019, 07:23:08 AM »
I also noticed a difference between TinyCore and TinyCorePure64: on TinyCore, there is one extra service showing up as started in services: fuse (this one does not appear on TinyCorePure64).

open-vm-tools not being listed as started holds true for TinyCore as well.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: open-vm-tools: error on shares mapping
« Reply #8 on: July 03, 2019, 10:52:02 AM »
Hi SeventhSin
Post the output of these commands:
Code: [Select]
which ps
cat /usr/local/etc/init.d/open-vm-tools

Offline andyj

  • Hero Member
  • *****
  • Posts: 1022
Re: open-vm-tools: error on shares mapping
« Reply #9 on: July 03, 2019, 11:57:25 AM »
I see this:



Have you added open-vm-tools to onboot.lst? Maybe you need to reboot?

SeventhSin

  • Guest
Re: open-vm-tools: error on shares mapping
« Reply #10 on: July 03, 2019, 12:16:35 PM »
Hi SeventhSin
Post the output of these commands:
Code: [Select]
which ps
cat /usr/local/etc/init.d/open-vm-tools

Here you go, Rich.

TinyCorePure64 10.1:

Code: [Select]
tc@tc-pure-10-1:~$ which ps
/usr/local/bin/ps


Code: [Select]
#!/bin/sh
# Start, stop, and restart vmtoolsd

grep -q user_allow_other /etc/fuse.conf || echo "user_allow_other" >>/etc/fuse.c                                                                                                                                                             onf

case "$1" in
start)

# Interface check
NIF1=$(wc -l < /proc/net/dev)

# Load vmblock
vmblock_dev=/tmp/VMwareDnD
vmblockfusemntpt=/var/run/vmblock-fuse
[ -d $vmblock_dev ] || mkdir -m 1777 -p $vmblock_dev

if grep -q "$vmblockfusemntpt" /etc/mtab; then
        true
else
        mkdir -m 1777 -p $vmblockfusemntpt
        vmware-vmblock-fuse -o subtype=vmware-vmblock,default_permissions,allow_                                                                                                                                                             other $vmblockfusemntpt
fi

# Start vmtoolsd
if pidof vmtoolsd &>/dev/null; then
        echo vmtoolsd already running
else
        rm -f /var/run/vmtoolsd.pid
        /usr/local/bin/vmtoolsd --background=/var/run/vmtoolsd.pid
fi

# add the following to .xession after mouse initialization if .xsession doesn't                                                                                                                                                              run scripts in /usr/local/etc/X.d
# [ $(which vmware-checkvm) ] && # [ vmware-checkvm ] && # vmware-user

# Use ethtool to optimize vmxnet
        if which ethtool &> /dev/null; then
                for e in $(grep eth /proc/net/dev|cut -d: -f1); do
                        ethtool -K $e gso on &> /dev/null
                        ethtool -K $e tso on &> /dev/null
                done
        fi

# Start DHCP client for new interfaces
if ! grep -q nodhcp /proc/cmdline; then
        NIF2=$(wc -l < /proc/net/dev)
        if [ $NIF2 -gt $NIF1 ]; then
                  /etc/init.d/dhcp.sh
        fi
fi
;;
stop)
        if pidof vmtoolsd &>/dev/null; then
                killall vmtoolsd
                echo stopped vmtoolsd
                umount -l /mnt/hgfs
        else
                echo vmtoolsd is not running
        fi
;;
restart)
        $0 stop
        $0 start
;;
*)
        echo "Usage: $0 (start|stop|restart)"
        exit 1
;;
esac

TinyCore 10.1:

Code: [Select]
tc@tc-10:~$ which ps
/usr/local/bin/ps


Code: [Select]
#!/bin/sh
# Start, stop, and restart vmtoolsd

grep -q user_allow_other /etc/fuse.conf || echo "user_allow_other" >>/etc/fuse.conf

case "$1" in
start)

# Interface check
NIF1=$(wc -l < /proc/net/dev)

# Load vmblock
vmblock_dev=/tmp/VMwareDnD
vmblockfusemntpt=/var/run/vmblock-fuse
[ -d $vmblock_dev ] || mkdir -m 1777 -p $vmblock_dev

if grep -q "$vmblockfusemntpt" /etc/mtab; then
        true
else
        mkdir -m 1777 -p $vmblockfusemntpt
        vmware-vmblock-fuse -o subtype=vmware-vmblock,default_permissions,allow_other $vmblockfusemntpt
fi

# Start vmtoolsd
if pidof vmtoolsd &>/dev/null; then
        echo vmtoolsd already running
else
        rm -f /var/run/vmtoolsd.pid
        /usr/local/bin/vmtoolsd --background=/var/run/vmtoolsd.pid
fi

# add the following to .xession after mouse initialization if .xsession doesn't run scripts in /usr/local/etc/X.d
# [ $(which vmware-checkvm) ] && # [ vmware-checkvm ] && # vmware-user

# Use ethtool to optimize vmxnet
        if which ethtool &> /dev/null; then
                for e in $(grep eth /proc/net/dev|cut -d: -f1); do
                        ethtool -K $e gso on &> /dev/null
                        ethtool -K $e tso on &> /dev/null
                done
        fi

# Start DHCP client for new interfaces
if ! grep -q nodhcp /proc/cmdline; then
        NIF2=$(wc -l < /proc/net/dev)
        if [ $NIF2 -gt $NIF1 ]; then
                  /etc/init.d/dhcp.sh
        fi
fi
;;
stop)
        if pidof vmtoolsd &>/dev/null; then
                killall vmtoolsd
                echo stopped vmtoolsd
                umount -l /mnt/hgfs
        else
                echo vmtoolsd is not running
        fi
;;
restart)
        $0 stop
        $0 start
;;
*)
        echo "Usage: $0 (start|stop|restart)"
        exit 1
;;
esac
« Last Edit: July 03, 2019, 12:42:43 PM by SeventhSin »

SeventhSin

  • Guest
Re: open-vm-tools: error on shares mapping
« Reply #11 on: July 03, 2019, 12:18:42 PM »
I see this:



Have you added open-vm-tools to onboot.lst? Maybe you need to reboot?

I have open-vm-tools-desktop.tcz in /mnt/sda1/tce/onboot.lst. Everything is backed-up, nice and juicy, no problem there.

I see that open-vm-tools misses the green check-box in your screenshot too. This is exactly how it shows in my Services app as well.

TinyCorePure64:



TinyCore:

« Last Edit: July 03, 2019, 12:28:38 PM by SeventhSin »

Offline andyj

  • Hero Member
  • *****
  • Posts: 1022
Re: open-vm-tools: error on shares mapping
« Reply #12 on: July 03, 2019, 12:29:33 PM »
I patched /usr/local/etc/init.d/open-vm-tools so the light comes on, but clicking the button doesn't do anything. I'm not sure what that program is looking for.

SeventhSin

  • Guest
Re: open-vm-tools: error on shares mapping
« Reply #13 on: July 03, 2019, 12:44:26 PM »
I patched /usr/local/etc/init.d/open-vm-tools so the light comes on, but clicking the button doesn't do anything. I'm not sure what that program is looking for.

I can confirm that clicking the service button doesn't do anything on any of the systems. Attempting to disable fuse on TinyCore 10.1 fails too, the green checkbox comes back after clicking it.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: open-vm-tools: error on shares mapping
« Reply #14 on: July 03, 2019, 12:51:11 PM »
Hi andyj
The  services  program is looking for a non-zero value to be returned from  /usr/local/etc/init.d/PogramName status. The  tftp
program uses this:
Code: [Select]
status)
pidof udpsvd
;;
The NFS utilities use this:
Code: [Select]
status)
if ps | awk '{print $3}' | grep -e "/usr/local/sbin/rpc.statd" >/dev/null && ps | awk '{print $3}' | grep -e "/usr/local/sbin/rpc.statd" >/dev/null && ps | awk '{print $3}' | grep -e "\[nfsd\]" >/dev/null; then
echo "NFS-server is running."
exit 0
else
echo "NFS-server is not running."
exit 1
fi
;;
If you use the latter, include this at the top of the file:
Code: [Select]
alias ps='busybox ps'