Can’t boot if you burn from Virtual Disk Plannex kicks other wireless brands in the ass
Aug 30

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

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Facebook
  • del.icio.us
  • Mixx
  • Google
  • Technorati
  • Live
  • NewsVine
  • YahooMyWeb
  • e-mail

written by mickeyckm

10 Responses to “Ubuntu equivalent of Windows’ autoexec.bat”

  1. 1
    neve Says:

    I’ve always wondered where a file like was in Linux/Ubuntu. Great find , though I’ve dropped on Linux a long time ago.

  2. 2
    mickeyckm Says:

    neve: Try Ubuntu with VirtualBox, it’s easy to install and setup.

  3. 3
    neve Says:

    If I only had the time… :D But I’ll try and remember. Thanks for the advice.

  4. 4
    munckfish Says:

    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

  5. 5
    Jauhari Says:

    I think /etc/rc.local is more complex than autoexec.bat in windows :D
    And beside more complex, /etc/rc.local more powerful too ;)

  6. 6
    Dale Says:

    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

  7. 7
    mickeyckm Says:

    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.

  8. 8
    =/ Says:

    ok, who copied who here?

    http://allanjosephbatac.com/blog/

  9. 9
    mickeyckm Says:

    what you mean?

  10. 10
    elvis Says:

    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.

Leave a Reply