You are not logged in.

#1 2021-08-08 16:01:53

thoth
Member
Registered: 2010-01-10
Posts: 112

VirtualBox Arch host, any guest with shared folder

Unlike this topic where Archlinux is guest.  I am running Arch linux as host.  With the host modules installed by `virtualbox-host-modules-arch`:

❯ lsmod|grep -i vbox
vboxnetflt             32768  2
vboxnetadp             28672  0
vboxdrv               528384  4 vboxnetadp,vboxnetflt

❯ uname -a
Linux vagabond 5.13.8-arch1-1 #1 SMP PREEMPT Wed, 04 Aug 2021 16:57:44 +0000 x86_64 GNU/Linux

However, while trying a recent Vagrantfile, I ran into this issue.  At first I was blaming the alpine312 image, and I was trying to correct the vbox modules in there. 

+    apk add virtualbox-guest-modules-virt
+    modprobe -a vboxsf
+    echo vboxsf > /etc/modprobe.d/vboxsf.conf

But that didn't seem to help.  Upon trying another Vagrantfile.  I am getting the same problem:

==> lb-0: Mounting shared folders...                   
    lb-0: /vagrant => /unreal/git/kubernetes-the-hard-way-vagrant              
Vagrant was unable to mount VirtualBox shared folders. This is usually          
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.     
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:       
                                                                                       
mount -t vboxsf -o uid=1000,gid=1000,_netdev vagrant /vagrant
                                                                                       
The error output from the command was:     
                                                                                       
/sbin/mount.vboxsf: mounting failed with the error: Invalid argument

I see some similar issues:
https://bbs.archlinux.org/viewtopic.php?id=223388
https://bbs.archlinux.org/viewtopic.php?id=260661
https://bbs.archlinux.org/viewtopic.php?id=257133

But no solution.

Issues to ignore as arch is guest and not host:
https://bbs.archlinux.org/viewtopic.php?id=244212
https://bbs.archlinux.org/viewtopic.php?id=255613
https://bbs.archlinux.org/viewtopic.php?id=239745
https://bbs.archlinux.org/viewtopic.php?id=243871
https://bbs.archlinux.org/viewtopic.php?id=251903
https://bbs.archlinux.org/viewtopic.php?id=258766
https://bbs.archlinux.org/viewtopic.php?id=228741
https://bbs.archlinux.org/viewtopic.php?id=220374
https://bbs.archlinux.org/viewtopic.php?id=138966
https://bbs.archlinux.org/viewtopic.php?id=77640
https://bbs.archlinux.org/viewtopic.php?id=198765

more debugging:

Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

mount -t vboxsf -o uid=1000,gid=1000,_netdev vagrant_data /vagrant_data

The error output from the command was:

mount: mounting vagrant_data on /vagrant_data failed: Invalid argument

vagrant up  10.81s user 6.14s system 37% cpu 44.808 total

$ vagrant ssh master0
master0:~$ lsmod|grep -i vbox
vboxsf                 86016  0
vboxguest             339968  2 vboxsf

master0:~$ sudo mount -t vboxsf -o uid=1000,gid=1000,_netdev vagrant_data /vagrant_data
mount.vboxsf: mounting failed with the error: Invalid argument
mount: mounting vagrant_data on /vagrant_data failed: Invalid argument
master0:~$ sudo mount -t vboxsf vagrant_data /vagrant_data
mount.vboxsf: mounting failed with the error: Invalid argument
mount: mounting vagrant_data on /vagrant_data failed: Invalid argument
master0:~$ sudo mkdir /mnt/vd
master0:~$ sudo mount -t vboxsf vagrant_data /mnt/vd
mount.vboxsf: mounting failed with the error: Invalid argument
mount: mounting vagrant_data on /mnt/vd failed: Invalid argument
master0:~$ sudo chmod 777 /mnt/vd
master0:~$ sudo mount -t vboxsf vagrant_data /mnt/vd
mount.vboxsf: mounting failed with the error: Invalid argument
mount: mounting vagrant_data on /mnt/vd failed: Invalid argument
master0:~$ df -h
Filesystem                Size      Used Available Use% Mounted on
devtmpfs                 10.0M         0     10.0M   0% /dev
shm                     494.9M         0    494.9M   0% /dev/shm
/dev/sda2               125.4G      1.3G    117.7G   1% /
tmpfs                    99.0M    252.0K     98.7M   0% /run
df: /sys/kernel/debug/tracing: Permission denied
/dev/sda1                92.8M     15.3M     70.5M  18% /boot
cgroup_root              10.0M         0     10.0M   0% /sys/fs/cgroup
/dev/sda2               125.4G      1.3G    117.7G   1% /var/lib/docker
master0:~$ sudo fdisk -l
Disk /dev/sda: 128 GB, 137438953472 bytes, 268435456 sectors
16709 cylinders, 255 heads, 63 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device  Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/sda1 *  0,32,33     12,223,19         2048     206847     204800  100M 83 Linux
/dev/sda2    12,223,20   325,85,16       206848  268435455  268228608  127G 83 Linux

Last edited by thoth (2021-08-08 16:13:49)

Offline

#2 2021-08-09 15:57:54

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,348

Re: VirtualBox Arch host, any guest with shared folder

Do the versions of virtualbox-host-modules-arch (host) and virtualbox-guest-modules-virt on the guest match ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2021-08-09 16:25:22

Smoerrebroed
Member
From: Germany
Registered: 2011-07-24
Posts: 115

Re: VirtualBox Arch host, any guest with shared folder

Does mounting work in a regular VM (not running through Vagrant)? If not, where is the folder you'd like to share located? I seem to recall that there was an issue sharing a folder that lives on a symlinked path.

Offline

#4 2021-08-10 11:34:39

thoth
Member
Registered: 2010-01-10
Posts: 112

Re: VirtualBox Arch host, any guest with shared folder

Ok starting with a fresh ubuntu bionic beaver install by hand (no vagrant), I insert the guest additions:

❯ sudo pacman -Ss virtualbox-guest-iso
community/virtualbox-guest-iso 6.1.26-1 [installed]
    The official VirtualBox Guest Additions ISO image

run it, poweroff, create a shared directory (named shared), and reboot

root@minibeaver:~# lsmod|grep -i vbox
vboxvideo              36864  0
ttm                   106496  2 vmwgfx,vboxvideo
drm_kms_helper        172032  2 vmwgfx,vboxvideo
drm                   401408  5 vmwgfx,drm_kms_helper,vboxvideo,ttm
vboxguest             294912  0

root@minibeaver:~# mount -t vboxsf shared /mnt/shared
/sbin/mount.vboxsf: mounting failed with the error: Invalid argument

Which is the same output I get with the mount command in the vagrant boxes.

Offline

#5 2021-08-10 11:57:41

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,348

Re: VirtualBox Arch host, any guest with shared folder

mount -t vboxsf shared /mnt/shared
man mount wrote:

The standard form of the mount command is:

          mount -t type device dir

I kinda doubt the guest knows how to access a device called shared .

Please post /etc/fstab and the output of lsblk -f   (both from the pov of the guest) .

Last edited by Lone_Wolf (2021-08-10 11:58:09)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#6 2021-08-10 13:14:39

thoth
Member
Registered: 2010-01-10
Posts: 112

Re: VirtualBox Arch host, any guest with shared folder

That's how I felt about the device name, but that is indeed how vagrant is reporting it as well.  But I am uncertain how the vboxsf device is supposed to look?  Can you post what it looks like in a working state?

```
root@minibeaver:~# lsblk -f
NAME   FSTYPE  LABEL           UUID                                 MOUNTPOINT
sda                                                                 
└─sda1 ext4                    7287a8c3-630b-4c1e-9d32-087000bc2603 /
sr0    iso9660 VBox_GAs_6.1.26 2021-07-28-16-34-25-54 

root@minibeaver:~# fdisk -l
Disk /dev/sda: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xdd9f9a06

Device     Boot Start      End  Sectors Size Id Type
/dev/sda1  *     2048 16775167 16773120   8G 83 Linux

root@minibeaver:~# blkid
/dev/sr0: UUID="2021-07-28-16-34-25-54" LABEL="VBox_GAs_6.1.26" TYPE="iso9660"
/dev/sda1: UUID="7287a8c3-630b-4c1e-9d32-087000bc2603" TYPE="ext4" PARTUUID="dd9f9a06-01"
```

I have also tried with 'automount' on in vbox settings, same results.

Last edited by thoth (2021-08-10 13:19:43)

Offline

#7 2021-08-13 13:00:47

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,348

Re: VirtualBox Arch host, any guest with shared folder

Personally I use qemu from CLI and if/when I need to share something between guest and host I use ftp or scp/sftp , not hypervisor dependent methods.

I've read up on VBox shared folders and they do indeed use the folder name on the host as default for the device on the guest .

Perhaps you could try installing an archlinux guest using https://wiki.archlinux.org/title/Virtua … as_a_guest to verify everything works as intended ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#8 2021-08-15 18:34:16

thoth
Member
Registered: 2010-01-10
Posts: 112

Re: VirtualBox Arch host, any guest with shared folder

Ya, I'm a fan of QEMU/KVM as well, my homelab is entirely based on it.

But I still need to test some of these Vagrant boxes out on VirtualBox as that was what the original author built them in and Vagrant does not support KVM in the same way as VirtualBox and just changing provider in vagrant has a host of other issues I'd rather not deal with.

Offline

Board footer

Powered by FluxBB