On my Ubuntu 11.10 machine, I use vbox (which is again an Ubuntu with source code on it). To take a daily update of a code, followed by testing - have to mount this box with every restart. Tried to change etc/fstab and also tried to bookmark it but it's not working. Could someone please help about it? Can a bash script be the solution?


Try editing /etc/fstab as root:

sudo nano /etc/fstab

Add this line at the end of the file:

mySharedFolderNameAsConfiguredInVBox /home/me/mysharedfolder vboxsf defaults 0 0

Note that /home/me/mysharedfolder must exist (mkdir /home/me/mysharedfolder).

Also keep an empty line at the end of /etc/fstab/ other whise it may not work.

Everything should be working now! ;)

  • Well, I apologize for creating confusion here. I don't have a shared folder in Vbox, rather it's an entire vbox that I would like to automount. Aug 16 '12 at 8:21
  • @Fagun What do you mean by a vbox? Is it the virtual machine or a virtual harddrive you want to mount to your vitrual machine?
    – MSIS
    Aug 16 '12 at 9:09
  • It's a virtual machine which I want to mount. Currently I am doing it by executing this command: sshfs <username>@<ipaddress>:/home /media/box, which gets unmounted as soon as system is off Aug 17 '12 at 7:16
  • Then create a new file /etc/init.d/S99mymount with the following inside: #!/bin/sh #place return here in your file # mounting the vbox: sshfs <username>@<ipaddress>:/home /media/box & # <-- Don't forget the "&" otherwise other system stuff won't start until this returns !!! #place return here in your file exit 0 #place return here in your file This script will be executed on the startup of your machine automatically.
    – MSIS
    Aug 17 '12 at 11:23
  • If the last comment worked I can correct the answer
    – MSIS
    Aug 17 '12 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.