Results 1 to 10 of 10

Thread: Ubuntu as VirtualBox guest attempts to mount shared folders twice at startup

  1. #1
    Join Date
    Mar 2009
    Beans
    20
    Distro
    Ubuntu 10.04 Lucid Lynx

    Ubuntu as VirtualBox guest attempts to mount shared folders twice at startup

    (Moved from main forum: http://ubuntuforums.org/showthread.php?t=1467757)

    I just upgraded my Ubuntu VirtualBox guest to Lucid.

    My host machine shares two folders with the guest. I have them listed in my /etc/fstab so they're automatically mounted:

    share /mnt/share vboxsf defaults 0 0

    For some reason, it looks like Ubuntu attempts to mount these shared folders twice. The first time, the mount doesn't succeed, but the second time, it does, so by the time I actually log in, the shares work properly.

    Karmic would just print an error message at boot, but now Lucid makes me press a key to continue booting when the mount fails.

    Ideally, I'd like to figure out how to make the first mount attempt work properly. But if that's complicated, just disabling Lucid's prompt would make me happy.

    Any ideas how I can go about accomplishing this?

    Thanks.

  2. #2
    Join Date
    Nov 2006
    Beans
    Hidden!

    Re: Ubuntu as VirtualBox guest attempts to mount shared folders twice at startup

    I have had the same problem and came across these two threads:
    https://bugs.launchpad.net/ubuntu/+s...ll/+bug/530179
    http://ubuntuforums.org/showthread.php?t=1440320&

    I found the following steps worked well for me.
    1)comment out the share mounting lines in /etc/fstab
    2)edit the /etc/rc.local file [not the /etc/init.d/rc.local file] to add the mount points in the form of: mount.vboxsf -w HOST_FOLDER /MOUNT_POINT

    e.g. my original /etc/rc.local file contained the following

    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    #
    exit 0

    It now looks like this

    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    # auto mount VirtualBox shared folders
    mount.vboxsf -w vm-share-work /media/share
    mount.vboxsf -w sdb8 /media/prog-lib
    mount.vboxsf -w apt-store-10.04-LTS /media/aptoncd
    # end of VirtualBox shared folders
    #
    exit 0

  3. #3
    Join Date
    Mar 2009
    Beans
    20
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Ubuntu as VirtualBox guest attempts to mount shared folders twice at startup

    Thanks, kc109; that worked great.

  4. #4
    Join Date
    May 2010
    Beans
    2

    Re: Ubuntu as VirtualBox guest attempts to mount shared folders twice at startup

    Worked for me, too!

  5. #5
    Join Date
    Aug 2009
    Location
    Pakistan
    Beans
    274
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Ubuntu as VirtualBox guest attempts to mount shared folders twice at startup

    in my case it's the other way arount.. i can't access my shared folder in ubuntu from xp guest machine.. like how to?

  6. #6
    Join Date
    Mar 2009
    Beans
    20
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Ubuntu as VirtualBox guest attempts to mount shared folders twice at startup

    abdusamed, you should create a new forum topic if you're having a different problem.

  7. #7
    Join Date
    Jan 2011
    Beans
    1

    Re: Ubuntu as VirtualBox guest attempts to mount shared folders twice at startup

    Superb! Thanks.

  8. #8
    Join Date
    Feb 2009
    Beans
    82

    Re: Ubuntu as VirtualBox guest attempts to mount shared folders twice at startup

    Quote Originally Posted by jlebar View Post
    (Moved from main forum: I have them listed in my /etc/fstab so they're automatically mounted
    Why did you choose /ect/fstab? What did you mean by automatically mounted?

  9. #9
    Join Date
    Jun 2012
    Beans
    2

    Re: Ubuntu as VirtualBox guest attempts to mount shared folders twice at startup

    I did exactly like what kc109 mentioned. Remove the entries in /etc/sftab and add the following lines to /etc/rc.local:

    mount.vboxsf -w work /home/my_user/work
    mount.vboxsf -w ws /home/my_user/ws

    But after rebooting, I still didn't see these folders mounted. If I mounted manually, I got:
    $ sudo mount -t vboxsf ws ~/ws
    /sbin/mount.vboxsf: mounting failed with the error: No such device

    Can someone help me how to fix this issue and automount those 2 directories after booting up? I already set work and ws to point to a folder on my laptop via Virtual Box Shared Folder option.

    Thanks,

  10. #10
    Join Date
    Jun 2012
    Beans
    2

    Re: Ubuntu as VirtualBox guest attempts to mount shared folders twice at startup

    I figured out why it doesn't work for me. I just recently updated my Virtual Box to 4.1.18, but I didn't re-update my Guest Addition accordingly. After updating Guest Addition, I was able to auto-mount using rc.local file as mentioned earlier. However, either /etc/rc.local or /etc/init.d/rc.local works for me.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •