Virtualbox not automounting shared folder in guest (Manjaro KDE v18.0.2)

I've done some googling, poking around and testing to see if I could fix this issue on my own, but without success. I suspect that I may be doing something wrong or have steps out of order.

The Issue: The automounting of a shared folder in the vbox guest does not happen in Manjaro KDE v18.0.2 guest.

Vbox Host and Guest: Manjaro KDE v18.0.2

Steps Taken:

1 - Install KDE 64bit v18.0.0 from verified ISO and reboot
2 - ran sudo pacman-mirrors --country United_States
3 - ran sudo pacman -Syyu
4 - reboot
5 - ran sudo pacman -Syu linux419-headers
6 - ran sudo mkdir /media
7 - reboot
8 - ran sudo pacman -S virtualbox-guest-utils
9 - setup shared folder in the host through the virtualbox app.
...folder path = /home/testjarokde/linux_projects
...folder name = linux_projects
...mount point = linux_projects
...automount and make permanent are checked
on the host I have a folder /home/testjarokde/linux_projects/my_tests
10 - reboot
11 - ran systemctl enable vboxservice
12 - systemctl start vboxservice
13 - gpasswd -a $USER vboxsf
14 - logout/in and no folders within the /media folder
15 - reboot
---> 16 - no folders within the /media

Within KDE guest:

inxi -Fxxxz within the KDE guest returns:
System:    Host: vboxjarokde Kernel: 4.19.13-1-MANJARO x86_64 bits: 64 compiler: gcc v: 8.2.1 Desktop: KDE Plasma 5.14.4 
           tk: Qt 5.12.0 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Virtualbox System: innotek product: VirtualBox v: 1.2 serial: <filter> Chassis: Oracle Corporation type: 1 
           serial: <filter> 
           Mobo: Oracle model: VirtualBox v: 1.2 serial: <filter> BIOS: innotek v: VirtualBox date: 12/01/2006 
CPU:       Topology: Quad Core model: AMD Ryzen 7 1700X bits: 64 type: MCP arch: Zen rev: 1 L2 cache: 2048 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 30415 
           Speed: 3800 MHz min/max: N/A Core speeds (MHz): 1: 3800 2: 3800 3: 3800 4: 3800 
Graphics:  Device-1: InnoTek Systemberatung VirtualBox Graphics Adapter driver: vboxvideo v: kernel bus ID: 00:02.0 
           chip ID: 80ee:beef 
           Display: x11 server: X.Org 1.20.3 driver: modesetting alternate: fbdev,vboxvideo,vesa compositor: kwin_x11 
           resolution: 1600x900~60Hz 
           OpenGL: renderer: llvmpipe (LLVM 7.0 128 bits) v: 3.3 Mesa 18.3.1 compat-v: 3.1 direct render: Yes 
Audio:     Device-1: Intel 82801AA AC97 Audio vendor: Dell driver: snd_intel8x0 v: kernel bus ID: 00:05.0 chip ID: 8086:2415 
           Sound Server: ALSA v: k4.19.13-1-MANJARO 
Network:   Device-1: Intel 82540EM Gigabit Ethernet driver: e1000 v: 7.3.21-k8-NAPI port: d000 bus ID: 00:03.0 
           chip ID: 8086:100e 
           IF: enp0s3 state: up speed: 1000 Mbps duplex: full mac: <filter> 
           Device-2: Intel 82371AB/EB/MB PIIX4 ACPI type: network bridge driver: piix4_smbus v: N/A port: d200 bus ID: 00:07.0 
           chip ID: 8086:7113 
Drives:    Local Storage: total: 15.00 GiB used: 7.33 GiB (48.9%) 
           ID-1: /dev/sda vendor: VirtualBox model: VBOX HARDDISK size: 15.00 GiB speed: 3.0 Gb/s serial: <filter> rev: 1.0 
           scheme: MBR 
Partition: ID-1: / size: 14.70 GiB used: 7.33 GiB (49.9%) fs: ext4 dev: /dev/sda1 
Sensors:   Message: No sensors data was found. Is sensors configured? 
Info:      Processes: 157 Uptime: 2h 31m Memory: 3.85 GiB used: 539.3 MiB (13.7%) Init: systemd v: 239 Compilers: gcc: 8.2.1 
           Shell: bash v: 4.4.23 running in: konsole inxi: 3.0.28

virtualbox-guest-utils is installed
sudo pacman -Qi virtualbox-guest-utils returns:
Name            : virtualbox-guest-utils
Version         : 6.0.0-1
Description     : VirtualBox Guest userspace utilities
Architecture    : x86_64
URL             : http://virtualbox.org
Licenses        : GPL  custom
Groups          : None
Provides        : None
Depends On      : glibc  pam  libx11  libxcomposite  libxdamage  libxext  libxfixes  libxmu  libxt  xorg-xrandr  VIRTUALBOX-GUEST-MODULES
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : virtualbox-archlinux-additions  virtualbox-guest-additions  virtualbox-guest-utils-nox
Replaces        : virtualbox-archlinux-additions  virtualbox-guest-additions
Installed Size  : 8.49 MiB
Packager        : Christian Hesse <arch@eworm.de>
Build Date      : Wed 26 Dec 2018 04:56:59 PM EST
Install Date    : Sat 05 Jan 2019 03:29:12 PM EST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

modinfo vboxguest returns:
filename:       /lib/modules/4.19.13-1-MANJARO/kernel/drivers/virt/vboxguest/vboxguest.ko.xz
license:        GPL
description:    Oracle VM VirtualBox Guest Additions for Linux Module
author:         Oracle Corporation
srcversion:     549BC80E4DF0AAFA1856D68
alias:          pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
depends:        
intree:         Y
name:           vboxguest
vermagic:       4.19.13-1-MANJARO SMP preempt mod_unload modversions 
sig_id:         PKCS#7
signer:         
sig_key:        
sig_hashalgo:   md4
signature:      30:82:02:A5:06:09:2A:86:48:86:F7:0D:01:07:02:A0:82:02:96:30:
                82:02:92:02:01:01:31:0D:30:0B:06:09:60:86:48:01:65:03:04:02:
                03:30:0B:06:09:2A:86:48:86:F7:0D:01:07:01:31:82:02:6F:30:82:
                02:6B:02:01:01:30:46:30:2E:31:2C:30:2A:06:03:55:04:03:0C:23:
                42:75:69:6C:64:20:74:69:6D:65:20:61:75:74:6F:67:65:6E:65:72:
                61:74:65:64:20:6B:65:72:6E:65:6C:20:6B:65:79:02:14:30:25:E9:
                C1:BA:34:1B:63:92:F6:D0:35:0C:64:59:71:41:C2:A0:5E:30:0B:06:
                09:60:86:48:01:65:03:04:02:03:30:0D:06:09:2A:86:48:86:F7:0D:
                01:01:01:05:00:04:82:02:00:76:51:01:A2:7F:90:68:54:97:7E:BA:
                47:BF:DE:44:BA:12:90:9A:34:5D:CD:7D:5B:C6:40:5C:00:98:33:58:
                8A:E2:9D:43:E0:1D:89:13:1D:65:1D:BA:C6:60:43:A5:AD:F0:40:50:
                CF:C3:9E:4F:B5:DF:C5:E6:3C:32:2B:B2:B9:A3:E0:15:49:02:32:11:
                06:E3:CE:03:CE:48:23:BC:59:B1:63:07:47:7A:1A:96:D4:94:8A:F3:
                06:66:C5:D0:6D:72:02:F7:41:DF:6C:69:CD:C2:36:55:82:73:90:BC:
                66:B4:89:DB:73:6C:0D:EF:FD:43:DA:13:C5:C7:EE:83:15:45:31:41:
                64:7F:22:30:65:1C:94:C6:29:18:01:A7:45:EA:E1:9C:59:6A:7E:9A:
                11:FE:E7:6C:A1:28:D6:0E:E2:9D:43:01:B1:00:79:46:06:7F:41:85:
                01:EA:09:48:DD:E3:AF:D7:90:AB:96:99:A4:FB:8A:CD:63:87:72:7A:
                EA:1C:37:0B:D1:14:15:51:25:78:DB:92:71:AE:47:9C:B5:95:8B:96:
                46:BF:22:BE:C9:F4:B4:F3:B0:96:37:12:D3:95:31:6A:77:20:C6:A8:
                CF:12:7A:F7:C7:88:3B:FC:15:D6:22:E6:BD:AF:47:91:AF:68:EB:8E:
                DE:6A:A3:07:CB:46:DC:90:2D:F4:47:E8:A4:FD:9D:7D:25:62:2F:EA:
                AC:C4:98:9A:8F:C9:23:A9:7F:0B:D8:B3:37:DA:6C:3B:A1:39:6C:23:
                B8:B2:4E:1A:02:FF:50:7C:05:97:01:EB:66:37:1A:3D:E3:B1:30:94:
                1F:61:18:DE:D2:ED:63:73:9F:47:2C:05:A9:D3:E4:06:E3:56:F8:D3:
                70:1D:18:76:48:22:8F:E0:11:4F:8E:6D:D3:29:03:FC:24:EA:E3:84:
                DB:B5:04:2F:73:BC:3F:F6:66:E1:7B:90:51:32:64:DB:E2:3C:8A:A1:
                4F:35:44:62:6B:84:F1:64:4F:47:F3:FA:73:1C:5A:29:A6:BE:D6:86:
                86:57:EE:AB:23:80:1A:6B:6C:48:53:7B:A1:D9:8A:F3:EC:78:D7:E4:
                EB:52:65:50:98:48:D4:27:59:2D:46:86:53:7D:B0:AA:BE:61:3C:99:
                5B:52:A7:32:EA:98:FD:FA:10:C2:D1:8D:7F:8F:E3:0B:3B:84:07:31:
                6B:06:5E:C5:CA:B1:55:A4:D4:62:EE:76:8B:72:47:7D:CF:9F:9C:54:
                3E:16:CF:24:BC:17:34:E2:79:87:D6:1E:8F:7C:DE:07:B2:B3:EC:7E:
                BA:B5:76:D9:2C:5C:3C:EC:9E:A2:61:B5:29:6C:48:3B:20:54:25:29:

sudo systemctl status vboxservice
● vboxservice.service - VirtualBox Guest Service
   Loaded: loaded (/usr/lib/systemd/system/vboxservice.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2019-01-05 21:18:32 EST; 1min 7s ago
  Process: 412 ExecStart=/usr/bin/VBoxService -f (code=exited, status=1/FAILURE)
  Process: 410 ExecStartPre=/usr/bin/modprobe vboxsf (code=exited, status=0/SUCCESS)
  Process: 396 ExecStartPre=/usr/bin/modprobe vboxvideo (code=exited, status=0/SUCCESS)
  Process: 390 ExecStartPre=/usr/bin/modprobe vboxguest (code=exited, status=0/SUCCESS)
 Main PID: 412 (code=exited, status=1/FAILURE)

Jan 05 21:18:32 vboxjarokde VBoxService[412]: 02:18:32.484851 main     6.0.0 r127442 started. Verbose level = 0
Jan 05 21:18:32 vboxjarokde VBoxService[412]: 02:18:32.485101 main     vbglR3GuestCtrlDetectPeekGetCancelSupport: Supported (#1)
Jan 05 21:18:32 vboxjarokde VBoxService[412]: 02:18:32.491617 main     Error: Failed to become guest control master: VERR_VERSION_MISMATCH
Jan 05 21:18:32 vboxjarokde VBoxService[412]: 02:18:32.491769 main     Error: Service 'control' failed to initialize: VERR_VERSION_MISMATCH
Jan 05 21:18:32 vboxjarokde VBoxService[412]: 02:18:32.491826 main     Session 0 is about to close ...
Jan 05 21:18:32 vboxjarokde VBoxService[412]: 02:18:32.491832 main     Stopping all guest processes ...
Jan 05 21:18:32 vboxjarokde VBoxService[412]: 02:18:32.491835 main     Closing all guest files ...
Jan 05 21:18:32 vboxjarokde VBoxService[412]: 02:18:32.491840 main     Ended.
Jan 05 21:18:32 vboxjarokde systemd[1]: vboxservice.service: Main process exited, code=exited, status=1/FAILURE
Jan 05 21:18:32 vboxjarokde systemd[1]: vboxservice.service: Failed with result 'exit-code'.

Strange Behavior: Vbox shared folder automount behaves as expected with a Manjaro Cinnamon v18.0.2 (guest) and Manjaro KDE v18.0.2 (host), but still fails with a KDE guest.

I don't remember the exact steps to get shared folders working in Cinnamon (guest). I could be wrong but I believe I did:

1 - Install Cinnamon 64bit v18.0.0 from verified ISO and reboot
2 - run sudo pacman -S linux419-headers
3 - reboot
4 - Insert the Virtualbox guest additions v5.2.20 ISO via host VBox UI
5 - run the install script via autorun in a terminal (which would have succeeded)
6 - eject the ISO/disk and reboot
7 - setup the shared folder in the host UI the same as shown above for the KDE guest VM
8 - run sudo usermod -a -G vboxsf testjarocinn
---> /media folder already exists

---> maybe run a chown command to grant access the shared folder

9 - reboot
---> I can access/read/write/create/list the /media/sf_linux_projects/ from within the Cinnamon guest OS.

10 - run sudo pacman -Syyu
11 - reboot
---> I can still access/read/write/create/list the /media/sf_linux_projects/ from within the Cinnamon guest OS.

Trying the above steps within a KDE guest breaks the guest OS to the point that shutdown and reboot commands do not work from the GUI or the command line, thus requiring the guest OS to be reinstalled from step-1.

Within Cinnamon guest:

vbox guest utils is not installed
sudo pacman -Qi virtualbox-guest-utils returns:
error: package 'virtualbox-guest-utils' was not found

modinfo vboxguest returns:
filename:       /lib/modules/4.19.13-1-MANJARO/misc/vboxguest.ko.xz
version:        6.0.0 r127566
license:        GPL
description:    Oracle VM VirtualBox Guest Additions for Linux Module
author:         Oracle Corporation
srcversion:     B589F7F4C3BE0472F92B7BE
alias:          pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
depends:        
name:           vboxguest
vermagic:       4.19.13-1-MANJARO SMP preempt mod_unload modversions

sudo systemctl status vboxservice returns:
Unit vboxservice.service could not be found.

I've always had trouble getting shared folders to automount as well.

Not a solution, but workaround aliases I use in VBox KDE client VMs to mount and unmount my shared folder manually when I need to file access to the Host.

alias vbmount='sudo mount -t vboxsf -o uid=1000,gid=1000 Host /home/manjaro/host'
alias vbumount='sudo umount -v /home/manjaro/host'

Host is the name of the shared folder.

2 Likes

I spent a couple of hours earlier today fixing all [but one] of my [Stable] Manjaro Guests in my Tower's Manjaro [Stable] KDE Host. The method i'll list below has been criticised previously by some Manjaroos as being at worst completely incorrect, or at best redundant... but historically nothing else for me has succeeded.

Weirdly my Xfce Guest's SF remained fine & dandy, & did not need my attention, but my KDE, Enlightenment & OpenBox Guests all had broken SFs until i performed the following. My Cinnamon Guest was in-between; with kernel 4.19 its SFs were good, but after i installed 4.20 today [meant to have done that previously but forgot] its SFs became broken like the others.

Definition: For me, my use of "broken" means that whereas these Guests' /media correctly shows both SFs, neither of them when drilled down into actually displays any contents at all.

Each time i install a new kernel, & boot into it, i have to repeat the following procedure. That is to say, Pacman/Pamac/Octopi kernel incremental version updates don't break the SFs, but when i use Manjaro Manager to, eg, install 4.20 when previously only [eg] 4.19 & 4.14 were installed, then the SFs break.

New versions of VB often [but weirdly not always] also break the SFs, necessitating all this palaver again.

  1. Once the VM/Guest is booted into the desired kernel, load the VirtualBox GA ISO into the virtual optical drive in the VM/Guest.
  2. Launch a terminal from within said ISO in the Guest's file manager.
  3. Run command sudo ./VBoxLinuxAdditions.run [not necessary in Cinnamon Guest, which cleverly & conveniently detects the presence of the command in said directory & politely offers to run it for you; i wish the other DEs would also do this].
  4. Patiently await this process to finish
Summary
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.0.0 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 5.2.16 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: Building the modules for kernel 4.20.0-1-MANJARO.
VirtualBox Guest Additions: Running kernel modules will not be replaced until the system is restarted
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the modules for kernel 4.20.0-1-MANJARO.
[kdemeoz@manjaro-VM VBox_GAs_6.0.0]$ 
  1. Reboot the VM.
  2. If lucky, once logged back in, SFs will now be fully functional. If unlucky they'll still be broken, & the process needs repeating [why? dunno!!]. In such cases they often seem to then come good, but sometimes still not. Whilst the next step does not have a 100% success rate, try:
  3. sudo chmod o+rx /media & reboot.

Sometimes nothing i try works... some specific combinations of kernel & VirtualBox versions seem resistant to anything i try. A couple of my VMs today that i repaired, last week had broken SFs & i wasted hours fighting them then... yet today i was able to fix them all. Probably the wind was blowing from the right direction, & Sagittarius was rising... :exploding_head:

My Unstable & Testing KDE VMs still have broken SFs. I fought them a lot last week & lost, so once i get some enthusiasm back i need to try again. :face_with_head_bandage:



UPDATE 23/1/19: My post here-above is now superseded by this thread; Widespread VirtualBox Shared Folders breakage with [Stable Update] 2019-01-17

@sueridgepipe:
Thank you. After doing some more testing/experimenting, I think a may have a temporary fix.
I made a backup copy of the guest VM's vdi file. The state of the backup guest would be at the point of reboot after the clean install of the OS from ISO. After replacing the broken vdi with the backup vdi:

1. Boot + log into the guest KDE VM.
2. run sudo mkdir /media
3. run sudo pacman-mirrors --country United_States
4. run sudo pacman -Syu linux419-headers
5. run sudo pacman -Rs linux419-virtualbox-guest-modules
6. reboot
7. Setup the shared folder using the host UI (same as stated in the first post).
8. Insert Virtualbox v6.0.0 Guest Additions ISO/disk into the guest VM via host side menu.
9. run the autorun installer script from the v6.0.0 Guest Additions ISO/disk
---> Toward the end of the script "modprode vboxsf" will fail.  Just ignore it.
10. Press enter when prompted by the script.
11. reboot
12. run sudo usermod -a -G vboxsf $USER
13. run sudo chown -R $USER:users /media/sf_linux_projects
14. logout and login
---> the shared folder should be automounted in /media/{shared folder name}

The "groups" command should show that your user is a member of the vboxsf group. Verify that you can access/read/write/create files and folders within your shared folder tree from within the guest. If you run "sudo pacman -Syyu" it should run and complete without issue. However, this probably means that pacman is unaware of the v6.0.0 Guest Additions install and who knows if this could lead to conflicts/problems down the road. However, it does fix the auto-mount for now. Manual uninstall of the v6.0.0 Guest Additions would be needed when the automount issue is resolved by Oracle <--> Arch folks <--> Manjaro team.

Just another tidbit of info:
The vboxservice is not enable/loaded/started using the above procedure. Running "sudo systemctl status vboxservice" returns:
Unit vboxservice.service could not be found.

1 Like

@Kadee:
Wow and thank you. It seems I stumbled upon your method. Based on my current, temporary, aufo-mount fix I now suspect that I used the v6.0.0 Guest Additions ISO in my Cinnamon VM instead of the v5.2.20.

[Side Note]
Cinnamon seems to be more "aware" or more "adept" at detecting media. Not only does it detect the ISO pseudo-insertion but it drops an icon on the desktop representing the auto-mounted shared folder. I'm hoping there is a setting in KDE to replicate Cinnamon's detection/response behavior.

It should be obvious the guest-utils must be the same version as the host.

It is also possible to use a script to mount your folders.

Create folders to mimic your shared folder names.

Create a file in your home folder:

touch ~/vboxmount.sh
chmod +x ~/vboxmount.sh

Edit the file and add the following content and save it.

#!/bin/sh
#-----------------------------------------------------------------------------
# Discover VirtualBox shared folders and mount them if it makes sense
# Folders with the same name must exist in the $USER home folder
#-----------------------------------------------------------------------------

if  !  type  VBoxControl  > /dev/null;  then
  echo  "VirtualBox Guest Additions NOT found"  > /dev/stderr
  exit 1
fi

MY_UID="$(id -u)"
MY_GID="$(id -g)"

( set -x;  sudo  VBoxControl  sharedfolder  list; )  |  \
grep      '^ *[0-9][0-9]* *- *'                      |  \
sed  -e 's/^ *[0-9][0-9]* *- *//'                    |  \
while  read  SHARED_FOLDER
do
  MOUNT_POINT="$HOME/$SHARED_FOLDER"
  if  [ -d "$MOUNT_POINT" ];  then
    MOUNTED="$(mount  |  grep  "$MOUNT_POINT")"
    if  [ "$MOUNTED" ];  then
      echo  "Already mounted :  $MOUNTED"
    else
      (
        set -x
        sudo  mount  -t vboxsf  -o "nosuid,uid=$MY_UID,gid=$MY_GID"  "$SHARED_FOLDER"  "$MOUNT_POINT"
      )
    fi
  fi
done

Run the script on login - e.g. creating a .desktop file in ~/.config/autorun

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by