Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from stackoverflow.com Aug 13 '12 at 10:04

This question came from our site for professional and enthusiast programmers.

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! ;)

share|improve this answer
    
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. – Fagun 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 – Fagun 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

You must log in to answer this question.

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