Aug 30
As usual, setting up in Virtual Box is fairly simple. I’ve installed Ubuntu on it and enabled the Virtual Box’s shared folder feature. To mount the shared folder on the system, I need to run the command below:
mount -t vboxsf <Shared_Folder_Name> <Local_Directory_Name>
However, the problem is I have to type it everytime I reboot the system. So I went out to search for the file that I can place my commands. The funny thing is I don’t know the exact term and I even tried the “Ubuntu equivalent of Windows’ autoexec.bat”.
Finally, I found it. It’s /etc/init.d/rc.local
Have fun.










August 30th, 2007 at 8:11 pm
I’ve always wondered where a file like was in Linux/Ubuntu. Great find , though I’ve dropped on Linux a long time ago.
August 30th, 2007 at 8:21 pm
neve: Try Ubuntu with VirtualBox, it’s easy to install and setup.
August 30th, 2007 at 9:05 pm
If I only had the time…
But I’ll try and remember. Thanks for the advice.
September 2nd, 2007 at 7:05 pm
Hi
Great blog, nice 3 column-iTheme.
I too have experienced the same problem where you just don’t know what words to put into to Google to get back what you want, all you know is the equivalent on the system your more familiar with yet that just doesn’t return anything quite like you’re looking for.
If you’re just getting into Linux you may want to look into the file /etc/fstab as this is standard file used to configure filesystems that should always be mounted on boot up. For more info type ‘man fstab’ in the Terminal.
Yes, /etc/init.d/rc.local will run everytime the system starts but on Ubuntu (as with most Linux systems) it is a system init (service startup) script and is one of the last to run. So for example your shared directory will only be mounted way after apache, mysql etc will have been started. The mount instructions in /etc/fstab will have been executed before the system services are started. The Linux boot process is quite simple and elegant and IMO worth looking into as a key to understanding quite a lot about how to configure Linux.
The other thing to note is that on Debian based systems like Ubuntu /etc/init.d/rc.local exists only to enable running of commands in the file /etc/rc.local which is the file end users are really supposed to edit. This is important as Debian takes care to separate out files which can be overwritten on upgrade from ones which users will have edited.
Happy Linux-ing
Cheers
September 4th, 2007 at 6:50 am
I think /etc/rc.local is more complex than autoexec.bat in windows

And beside more complex, /etc/rc.local more powerful too
September 6th, 2007 at 3:59 am
And why not to edit /etc/fstab to include that mountpoint? I think that you only have to append a line like this one:
[Shared_Folder_Path] [Local_Directory_Path] vboxsf defaults 0 0
September 8th, 2007 at 6:11 am
Jauhari: That’s interesting. I’m still new to Linux. Thanks for the tip.
Dale: Thanks, I will give it a try again. I was trying the /etc/fstab the other day, but it didn’t work. So I resolved to /etc/init.d/rc.local.
September 14th, 2007 at 6:14 am
ok, who copied who here?
http://allanjosephbatac.com/blog/
September 14th, 2007 at 7:10 am
what you mean?
September 27th, 2007 at 7:07 am
As mentioned, anything you want automatically mounted at boot should be set up in /etc/fstab. Running mount commands from /etc/rc.local is not a good idea, especially if the command has a tendency to hang or lag (say, the network is down).
“man fstab” for more information, or see how your existing /etc/fstab is written to get an idea of how it works.