Edit rc.local file on Linux guest?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Poci
Posts: 17
Joined: 13. May 2013, 19:23

Edit rc.local file on Linux guest?

Post by Poci »

Hi, Im running Linux Mint 14.1 as a guest on Win 8.

I have a shared folder between both of them but I have to input mount command everytime I run the VM.

I was told there is a way to make the share folder mount permanent by editing rc.local file in Linux.

How do I do this?
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Re: Edit rc.local file on Linux guest?

Post by stefan.becker »

Its all written, you only have to read it.

Look into the manual. There is the automount of shared folders described.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Edit rc.local file on Linux guest?

Post by Perryg »

You add the mount statement to the (guests) /etc/rc.local file by editing it as sudo.

be sure to add the statement before the "exit 0" line in the file.

Example:

Code: Select all

# By default this script does nothing.

mount -t vboxsf -o rw,uid=1000,gid=1000 shared /mnt/shared

exit 0
Poci
Posts: 17
Joined: 13. May 2013, 19:23

Re: Edit rc.local file on Linux guest?

Post by Poci »

Yes but what program do I use to edit the rc.local file.

Sorry for being a pain in the butt but im a total Linux n00b.
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Re: Edit rc.local file on Linux guest?

Post by stefan.becker »

vi, gedit, ... Whatever is installed.

I think you are missing linux know how. But that is not the topic of this forum.
Poci
Posts: 17
Joined: 13. May 2013, 19:23

Re: Edit rc.local file on Linux guest?

Post by Poci »

Of course Im missing Linux know how, im a n00b with Linux, been using Winblows my whole life since 98 lol.

Ok the Linux Im using as guest is Mint 15 MATE.

Which program does it have that I should use for editing the rc.local file?
Poci
Posts: 17
Joined: 13. May 2013, 19:23

Re: Edit rc.local file on Linux guest?

Post by Poci »

Ok I managed to get vi installed and opened the rc.local file and input the command parameters but when I try and save it says its read only use ! to override. Now what?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Edit rc.local file on Linux guest?

Post by Perryg »

@Poci,
How to use Linux is not in the scope of this forum. You should ask the mint forums on how to do these kind of things.

Hint: you need to use sudo to open the file in vi. It requires elevated permission to edit is.
Poci
Posts: 17
Joined: 13. May 2013, 19:23

Re: Edit rc.local file on Linux guest?

Post by Poci »

Perryg wrote:@Poci,
How to use Linux is not in the scope of this forum. You should ask the mint forums on how to do these kind of things.

Hint: you need to use sudo to open the file in vi. It requires elevated permission to edit is.
So how do I do that?

I open terminal in rc.local folder and then what?

Sorry but Id rather ask here, I don't want to go have to register at Linux mint forums. Please help me.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Edit rc.local file on Linux guest?

Post by Perryg »

Code: Select all

sudo vi /etc/rc.local
But you had better go ahead and register with your distro forums.
Post Reply