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

I installed Fedora in Virtual Box with host windows xp.
I want to share file between host and guest. Someone suggest me to run the command in fedora

#sudo mount -t vboxsf -o uid=1000,gid=1000 F_DRIVE /home/menjar/Desktop/xp

where F_DRIVE is the F drive in xp I am sharing and 'xp' is the folder in fedora where I want to mount.
Now It works but when I reboot, I can't see the contents of xp folder anymore.
After goggling I find a suggestion that say to add the command in /etc/rc.local file. I am very new in linux so I want to know how do I do this. I have tried to do this by using vi editor by running #vi /etc/rc.local and I add the line

 sudo mount -t vboxsf -o uid=1000,gid=1000 F_DRIVE /home/menjar/Desktop/xp

and save by pressing Esc and then :wq but after doing I couldn't see any result. It still doesn't work.

So please explain how do I do this step by step (I am very new and don't know anything about Linux)? Am I doing something wrong with the command? should I have to place a '#" in front of the command while placing the line in /etc/rc.local? Please explain how do I solve it in detail.

share|improve this question

I would suggest adding the line to the /etc/fstab file, so the volume can be mounted at boot time.

A guide is here:

http://www.tuxfiles.org/linuxhelp/fstab.html

You must be root to edit the file, so you will start with:

sudo vi /etc/fstab

Your line will look like this:

F_DRIVE    /home/menjar/Desktop/xp    vboxsf    uid=1000,gid=1000    0 0

You maybe want to add rw to the mount options.

For troubleshooting also look at: My virtualbox fstab will not auto-mount on reboot?

share|improve this answer
    
True of course. I was trying to get the question answered rather than providing a solution to the actual problem. – Mr Lister Jul 20 '12 at 8:45

The file belongs to root (the administrator account) so you won't be able to write to it as a normal user.

The solution is to run vi as root with the sudo command. sudo vi ...

share|improve this answer
1  
Actually, running sudoedit is preferred: 1) which editor is used is decided by VISUAL / EDITOR; 2) the editor itself runs without superuser priviledges. Actually, allowing a user to sudo vi is a grave mistake by the admin, unless you want the user to have full root access to the system. – DevSolar Jul 20 '12 at 8:42
    
Thanks, never knew about sudoedit, that's a handy command, and definitely safer. – Ibrahim Dec 4 '12 at 5:45

You must log in to answer this question.

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