Search:

PmWiki

pmwiki.org

edit SideBar

Main / Virtualbox

Solving the shared drive mount problem

Try this for the first steps: http://www.giannistsakiris.com/2008/04/09/virtualbox-access-windows-host-shared-folders-from-ubuntu-guest/

http://mohammadaaprilianto.blogspot.com/2012/09/solved-unknown-filesystem-type-vboxsf.html
After adding the Windows folder and the Linux share name to the Shared Folders list in the VirtualBox Manager, run this command on the Linux guest

sudo mount -t vboxsf <share_folder> /home/<user>/<share_folder>
or
sudo mount -t vboxsf -o uid=<userid>,exec,rw <share_folder> /home/<user>/<share_folder>

If you get an error when trying to do a copy from linux to the shared drive Cannot create regular file... File exists try touching the shared destination from the command line and then copy. Had this issue once after deleting the file on the Windows side.

Another problem is the inability to change ownership of the files on the share.
http://superuser.com/questions/640027/why-cant-i-chown-a-virtualbox-shared-directory

SSH to the Guest

Go into the Network settings in the VirtualBox Manager. In Port Forwarding, add Host port 3022, guest port 22, name ssh, other left blank. Install SSH on your guest sudo apt-get install openssh-server Connect with ssh -p 3022 user@127.0.0.1

If you set export DISPLAY=":0.0"' then you'll get the windows you open with your ssh connection appearing in the guest instead of on the host. It turns out that it doesn't work correctly using the command line SSH. You have to use putty for some reason. Connect to user@127.0.0.1 and set the port to match the host port you've set up.

Adding a second hard drive

Create a directory for it. Install and use gparted to create a partition (on /dev/sdb). Use mkfs to create an ext4 file system on the device. Then add the entry to /etc/fstab to mount it on boot. Reboot.

Other Notes

If the VB guest doesn't see your USB devices, go to the Devices menu to activate.

Be careful with installing guest OS additions with a mounted GA .iso. https://forums.virtualbox.org/viewtopic.php?f=1&t=60702

Clock skew problem

If your Ubuntu guest clock is even a tiny bit behind Windows host, you'll have a problem compiling. Set the Ubuntu clock ahead manually just a bit.

VHD UUID problem

You won't be able to attach a copied drive that shares the same UUID to the same virtual machine. To make the UUID distinct, you must use either the clone command or sethduuid:
http://www.groovypost.com/howto/virtualbox-error-uuid-hard-disk/

Turns out you can mount a VHD on Windows host using the Computer Management tool.

VDI UUID problem

You can move the virtual machine .vdi drive by starting the virtual machine and powering it off and then remove it in the Storage section of the Manager. The .vdi file can then be moved, but when you try to re-attach it will complain about UUID re-use. Use VBoxManage internalcommands sethduuid <file.vdi> command to generate a random new ID, then attach it in the Manager.

Networking

--6.1--
When you install VB on Win10, by default the NAT mode is enabled for adapter 1 and this allows the guest VM to get an automatic connection to the wireless port. It should instantly have a WAN connection. VB actually provides it's own DHCP service behind the NAT to give a separate IP address to the guest VM interface, so it won't align with your host OS IP.

If you want to use the wired eth port of the host, then you need to add an adapter in the VB manager with the guest VM off. Set it to Bridged Adapter mode. When you start the VM a new interface should be available. You can set an address to the same subnet as the host OS eth port, and they will now be able to connect to one another. You can also now connect to the VM from another machine on the physical network.

https://www.nakivo.com/blog/virtualbox-network-setting-guide/

--older--
You can share a network port between host and guest. Go to the manager network settings and add the port as visible to the guest OS. It seems as though you don't need to set an IP address on the guest to see devices on that IF.

If you try to start the VM and get an error about a nonexistent host networking interface, you will have to discard the saved state of the OS and reset it.

Ubuntu As Host

By default, the guest OS won't be able to see your USB devices even if you do the guest additions and you have the Extension pack installed. The problem is that the host VirtualBox application itself cannot see the USB devices. You have to add your username and root to the vboxusers group (sudo add root vboxusers) and then restart.


Page last modified on July 11, 2022, at 07:53 PM