I have a Windows XP VM solely for the purpose of using Quicken. I have all my documents in my home folder including the Quicken files, to which the VM sees via a Samba share.
If the Ubuntu One sync daemon is running while I'm using Quicken, I cannot edit or modify transactions due to however U1 locks the file. So I made a script to stop the U1 daemon before the VM starts, then start it back up again after the VM shuts down if it was running to begin with.
All was working well, or so I thought. If I have a lot to do in Quicken therefore having the VM open for longer than 20 minutes, the U1 sync daemon will start up again and start syncing my files, causing Quicken to at least prevent me from editing anything and at worst locking up which forces me to shut it down and lose work.
How can I prevent the daemon from starting again unless I tell it to?
Below is the script I am currently using:
#!/bin/bash
u1exist=yes
u1running=no
vm=a7a66504-3370-4462-89b1-25b5ee833528
vmcomment="Windows XP"
# silly check, is VirtualBox installed?
hash /usr/lib/virtualbox/VirtualBox 2>/dev/null || { echo >&2 "This is a wrapper script for VirtualBox, which is not installed on this machine. Aborting."; exit 1; }
#check to see if UbuntuOne is even installed
hash u1sdtool 2>/dev/null || { u1exist=no; }
printf "%s" "UbuntuOne sync-daemon running: "
if [ "$u1exist" == "yes" ]; then
# check to see if the sync-daemon is running
ustat=`u1sdtool -s | awk 'BEGIN {FS=" "} /is_connected/ {print $2}'`
if [ "$ustat" == "True" ]; then
u1running=yes
fi
echo $u1running
else
echo "does not exist."
fi
if [ "$u1running" == "yes" ]; then
echo "Turning off UbuntuOne syncing while VM is running. Don't worry, we'll turn it back on when the VM is shut down!"
u1sdtool -q
fi
echo "Starting virtual machine..."
/usr/lib/virtualbox/VirtualBox --comment $vmcomment --startvm $vm
if [ "$u1running" == "yes" ]; then
# only turn U1 back on if it was running to begin with
printf "%s" "Turning UbuntuOne sync-daemon back on: "
u1sdtool -c
echo "done."
fi
Edit: Meant to include that I am using Ubuntu 12.04.