You are not logged in.

#1 2014-04-08 20:23:50

oliver
Member
Registered: 2007-12-12
Posts: 448

VirtualBox clipboard issue AKA why doesn't this restart script work?

The host is Windows7, the guest is up-to-date Arch and everything I describe is for guest-to-host or host-to-guest copy and paste.  The clipboard within the guest never fails.  The VirtualBox Guest configuration has the clipboard set to 'bi-directional.'

I'm starting the clipboard via .xinitrc which includes the following line

VBoxClient-all &

This is what gets launched

oliver   211     1  0 15:33 ?        00:00:00 /usr/bin/VBoxClient --clipboard

It all works perfectly for an indiscriminate amount of time, then suddenly, it stops updating the buffer.  If I try to copy/paste anything new, I get the last entry before it stopped working.  If I restart it (by killing the process and running VBoxClient --clipboard) it works again for an indiscriminate time.  Wash/rinse/repeat.

I wrote a quick script to run from cron but it's having problems

This is the script

#!/usr/bin/bash

PID="$(ps -ef|grep -i "[v]boxclient --clipboard" | awk '{print $2}')"

kill $PID && /usr/bin/VBoxClient --clipboard

exit 0

I watched the cronjob and it appears to be doing what I want but a 'ps' doesn't show it running afterwards

++ grep -i '[v]boxclient --clipboard'
++ awk '{print $2}'
++ ps -ef
+ PID=3158
+ kill 3158
+ /usr/bin/VBoxClient --clipboard
+ exit 0

I'm assuming cron runs the command in a shell that gets destroyed when the cronjob is done or something and this is tearing down the process.  I've tried modifying the command with nohup and ampersands to no avail.

A fix for the underlying problem would be great but I'm assuming I'll be waiting on Oracle for that.  In the meantime, if I could restart this thing periodically it would help me out a bit.

Any ideas?

Offline

#2 2014-08-20 18:05:14

dopalek
Member
Registered: 2014-06-06
Posts: 20

Re: VirtualBox clipboard issue AKA why doesn't this restart script work?

I have the same problem - VBoxClient stops working and restarting it from cron does not work.
I run this from cron every 10 minutes:
(killall VBoxClient && VBoxClient-all) || VBoxClient-all

and VBoxClient is killed every time but is not launched again. How can you explain it?

Offline

Board footer

Powered by FluxBB