1

On boot I want the following two things to happen in order:

  1. Start up a VirtualBox machine

  2. Mount a folder (only after the VB machine is booted) on that VB guest onto the local host machine (via sshfs)

I know how to mount a folder via sshfs, but how do I make those two steps happen at boot and in that order?

1
  • Do you know how to start a VM at boot? Commented Feb 1, 2014 at 9:45

1 Answer 1

1

It is actually rather easy.

Brendan Kidwell's Web site gives you a good intro to his script to start your VM at boot. One of the great advantages of this script is that it does not shutdown your VM if you power off your host, but rather it allows to configure things so that your VM is hybernated. That means that, upon host reboot, the VM will pick up wherever it had left off.

The script can be found here.

In order to complete your request, all you have to do is to introduce the call to mount the shared folder in the sub-routine do_wait_for_online, immediately before the line that states:

    echo Ready

and to start the service not with start, but with start-wait. The difference between the two is that the second one will wait for the VM to come online, which is the earliest moment in which you can mount a shared folder via sshfs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .