Mount VirtualBox SharedFolder in Ubuntu VM at startup


James P. Wright

I have an Ubuntu VM running in VirtualBox.
I set up shared folders because I created a folder in mysharemy home directory ( ~/jamesw) host. Using the line sudo mount -t vboxsf myshare hostin the home directory in the terminal mounts the drive correctly, but if I reboot, the drive doesn't mount again.

This is the VM I use to run a simple web server, I want this share to be mounted every boot. What is the solution? Especially considering it requires sudo?

thanks

Automatically mount shared folders with Virtual Box Manager

From Virtual Box > 4.0, we were able to automount shared folders in virtual machines . For this we have Ubuntu

  • Requires guest additions to be installed in the guest OS
  • Make sure the user is in the groupvboxsf
  • Define shared folders from Virtual Box Manager

Right-click on your virtual machine and select Settings -> Shared Folders . This will list existing shares, or let you define a new shared folder by clicking on the blue folder icon with a green +-sign in the upper right corner :

enter image description here

Select your folder from the drop-down menu " Folder Path ", or select " Define Other " for the file chooser that lists the host's file system . Choose a name for the share (eg myshares ). By checking automount, the folder will always be mounted in the Ubuntu guest directory (the prefix will be added automatically)./media/sf_mysharessf_


Alternatively, to define a shared folder in a running guest OS, we can choose Devices -> Shared Folders from the Virtual Box Manager's window menu :

enter image description here

By ticking the permanent setting, these shared folders will also be available on the next boot and will be mounted when automount is additionally ticked .

Related


Mount VirtualBox SharedFolder in Ubuntu VM at startup

James P. Wright I have an Ubuntu VM running in VirtualBox. I set up shared folders because I created a folder in mysharemy home directory ( ~/jamesw) host. Using the line sudo mount -t vboxsf myshare hostin the home directory in the terminal mounts the drive c

Mount VirtualBox SharedFolder in Ubuntu VM at startup

James P. Wright I have an Ubuntu VM running in VirtualBox. I set up shared folders because I created a folder in mysharemy home directory ( ~/jamesw) host. Using the line sudo mount -t vboxsf myshare hostin the home directory in the terminal mounts the drive c

Mount VirtualBox SharedFolder in Ubuntu VM at startup

James P. Wright I have an Ubuntu VM running in VirtualBox. I set up shared folders because I created a folder in mysharemy home directory ( ~/jamesw) host. Using the line sudo mount -t vboxsf myshare hostin the home directory in the terminal mounts the drive c

Start VirtualBox and VM in Windows startup

Larry Martell I am running VirtualBox in Windows Server 2016. When Windows starts, I want to start VirtualBox and VM in it. I've seen some posts about starting VB on Windows startup, but I'm not getting it to help. Even if I do, the VM doesn't start automatica

Start VirtualBox and VM in Windows startup

Larry Martell I am running VirtualBox in Windows Server 2016. When Windows starts, I want to start VirtualBox and VM in it. I've seen some posts about starting VB on Windows startup, but I'm not getting it to help. Even if I do, the VM doesn't start automatica

Start VirtualBox and VM in Windows startup

Larry Martell I am running VirtualBox in Windows Server 2016. When Windows starts, I want to start VirtualBox and VM in it. I've seen some posts about starting VB on Windows startup, but I'm not getting it to help. Even if I do, the VM doesn't start automatica

Start VirtualBox and VM in Windows startup

Larry Martell I am running VirtualBox in Windows Server 2016. When Windows starts, I want to start VirtualBox and VM in it. I've seen some posts about starting VB on Windows startup, but I'm not getting it to help. Even if I do, the VM doesn't start automatica

Start VirtualBox and VM in Windows startup

Larry Martell I am running VirtualBox in Windows Server 2016. When Windows starts, I want to start VirtualBox and VM in it. I've seen some posts about starting VB on Windows startup, but I'm not getting it to help. Even if I do, the VM doesn't start automatica

How to mount VirtualBox shared folders at startup?

Tonga I installed Ubuntu in Virtualbox. I want to automatically mount my VirtualBox shared folder in Ubuntu when I log in to Ubuntu. I put the following lines into ~. /bashrc and ~/.bash_profile: sudo mount -t vboxsf windows_share /media/windows_share where w

How to mount VirtualBox shared folders at startup?

Tonga I installed Ubuntu in Virtualbox. I want to automatically mount my VirtualBox shared folder in Ubuntu when I log in to Ubuntu. I put the following lines into ~. /bashrc and ~/.bash_profile: sudo mount -t vboxsf windows_share /media/windows_share where w

Mount non-USB device on Virtualbox VM

Quest Monger I have Windows 7 running on bare metal. I installed the Haupage TV tuner card on it and Win 7 detects the card and makes it run smoothly. I now have Vitualbox installed on Win7 and have created an Ubuntu VM. I want to install the tuner card to thi

Mount non-USB device on Virtualbox VM

Quest Monger I have Windows 7 running on bare metal. I installed the Haupage TV tuner card on it and Win 7 detects the card and makes it run smoothly. I now have Vitualbox installed on Win7 and have created an Ubuntu VM. I want to install the tuner card to thi

Custom Ubuntu 20.04 VirtualBox VM

Mastrogeppetto I need to make custom VirtualBox VMs (available as .ova) for teaching: one an Ubuntu server with a terminal interface and LAMP, the other a minimal desktop Ubuntu with only selected applications available. I need them to be lightweight because s

Install Ubuntu 15.04 on VirtualBox VM

Chris I'm taking a university course on Unix and as part of it I'm trying to use Ubuntu's live USB on my computer. My computer is running 64bit Windows7. I installed VirtualBox on a 16 GB flash drive using LinuxLive. I had trouble installing 64-bit Ubuntu 15.0

Install Ubuntu 15.04 on VirtualBox VM

Chris I'm taking a university course on Unix and as part of it I'm trying to use Ubuntu's live USB on my computer. My computer is running 64bit Windows7. I installed VirtualBox on a 16 GB flash drive using LinuxLive. I had trouble installing 64-bit Ubuntu 15.0

Change startup disk on Ubuntu VM

we say I have a sandboxed Ubuntu server VM (virtual machine) with a single drive. Recently I needed to expand my server's disk space, so I created a second disk. I dd'd have the original /dev/sdanew /dev/sdband with the extended partition size partedand size r

Unable to mount USB device to Windows 10 VirtualBox VM

general I'm having trouble connecting a USB device to a Windows 10 VM on VirtualBox. My host is a Dell Inspiron 15 laptop running the latest Kubuntu 19.0 (Disco Dingo). I also installed the VirtualBox extension pack and enabled USB 2.0 device support under VM

Unable to mount USB device to Windows 10 VirtualBox VM

general I'm having trouble connecting a USB device to a Windows 10 VM on VirtualBox. My host is a Dell Inspiron 15 laptop running the latest Kubuntu 19.0 (Disco Dingo). I also installed the VirtualBox extension pack and enabled USB 2.0 device support under VM

Can't connect to internet in VirtualBox VM - Ubuntu

Milad Na I have installed Ubuntu on a VM in VirtualBox and created 2 clones from it. Everything was fine, but after a while the internet connection failed for all VMs in VirtualBox. Here are the network settings: bridge adapter allow all (I also checked allow

Running Oracle VM VirtualBox on Ubuntu 13.04

inix software When I try to run Oracle VM VirtualBoxit says I need to add a kernel module and recompile the linux kernel for it to work. The error I get is: Warning: vboxdrv kernel module not loaded. There are no modules available for the current kernel, or th

How To Run Oracle VM VirtualBox on Ubuntu 13.04

Poohtedoo This might be a really stupid question. But I'm on Ubuntu 11.04 and I upgraded to 13.04. I have successfully installed oracle virtual box. But I can't seem to find the application (oracle VM box) dashhome under applications? How do I find the executa

Running Oracle VM VirtualBox on Ubuntu 13.04

inix software When I try to run Oracle VM VirtualBoxit says I need to add a kernel module and recompile the linux kernel for it to work. The error I get is: Warning: vboxdrv kernel module not loaded. There are no modules available for the current kernel, or th

Network not working on Ubuntu VirtualBox VM created by Packer

dmayo3 I am trying to build a VirtualBox Ubuntu VM with Packer. My image was successfully created and configured to use the Wi-Fi (Mac OS X AirPort) interface for bridged networking. However, after starting the VM, only the loopback interface is set up. EDIT:

How To Run Oracle VM VirtualBox on Ubuntu 13.04

Poohtedoo This might be a really stupid question. But I am using ubuntu 11.04 and I upgraded to 13.04. I have successfully installed oracle virtual box. But I can't seem to find the application (oracle VM box) dashhome under applications? How do I find the exe

Internet connection for Ubuntu VM in virtualbox on company laptop

Preston Roy I'm working on a project with an Ubuntu 16.04.2 desktop installed on a virtual machine using a proper laptop (with important security measures, but no admin rights yet). I can't get internet connection in the VM. I've tried all available network co

Access server on Ubuntu VM in VirtualBox with host offline

Page__ I have an Ubuntu VM running on VirtualBox and several servers are running on this VM that I need to access from the host. The host needs to be disconnected (offline) from any network. What kind of network do I want to define for this VM and how do I acc

Install Docker into a VirtualBox VM running Ubuntu 12.04

RAM I have virtual box in my ubuntu 14.4 system and vagrant is installed in virtual box. But if I try to install docker into vagrant's vm and use the following command in vagrant's machine docker --version It shows the docker version and options like -help -di

How to setup another monitor with Ubuntu VM (virtualbox)?

Andrew I'm running a Windows 7 host, Ubuntu guest in VirtualBox. I have guest additions installed, but when I go to display settings it still shows Unknown Display and doesn't allow me to add another monitor (following the instructions I found online to add an

How to setup another monitor with Ubuntu VM (virtualbox)?

Andrew I'm running a Windows 7 host, Ubuntu guest in VirtualBox. I have guest additions installed, but when I go to display settings it still shows Unknown Display and doesn't allow me to add another monitor (following the instructions I found online to add an