1

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.

Dave M
  • 13,250
Menjar Ali
  • 11
  • 1
  • 1
  • 2

2 Answers2

1

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?

0

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 ...

Mr Lister
  • 286