(Solved) Files sharing btw Ubuntu host and Kubuntu vm

Discussions related to using VirtualBox on Linux hosts.
Post Reply
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

(Solved) Files sharing btw Ubuntu host and Kubuntu vm

Post by satimis »

Hi all,

It took me more than an hour unable to sort out the problem of sharing files btw Ubunu 22.04 Host and Kubuntu 22.04 VM

VirtualBox Guest Edition has been installed

sharefolder has been created on Kubuntu

On Kubuntu Terminal:
$ ls -ald /home/satimis/sharefolder/

Code: Select all

drwxrwxr-x 2 satimis satimis 4096 Dec  1 15:54 /home/satimis/sharefolder/
Also having run;
$ sudo usermod -a -G vboxsf "$USER"

Drag files from Ubuntu (host) Transfer folder
to:
Kubuntu VM sharefolder doesn't work

Please help.

Thanks

Regards
Last edited by satimis on 6. Dec 2023, 04:51, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Files sharing btw Ubuntu host and Kubuntu vm

Post by scottgus1 »

Possibly related to viewtopic.php?t=110665 same host, different VM.
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: Files sharing btw Ubuntu host and Kubuntu vm

Post by satimis »

scottgus1 wrote: 4. Dec 2023, 14:27 Possibly related to viewtopic.php?t=110665 same host, different VM.
Yes, it is correct in the same PC

Is there a solution, in stead of running Samba. But Kubuntu is Linux not Windows

Regards
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Files sharing btw Ubuntu host and Kubuntu vm

Post by scottgus1 »

Let's check the Guest Additions.

Please start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. In the "Logs" subfolder, zip the VM's "vbox.log", and post the zip file, using the forum's Attachments tab. (Configure your host OS to show all extensions so you can find the "vbox.log", not "vbox.log.1", etc.)
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: Files sharing btw Ubuntu host and Kubuntu vm

Post by satimis »

scottgus1 wrote: 4. Dec 2023, 19:32 Let's check the Guest Additions.

Please start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. In the "Logs" subfolder, zip the VM's "vbox.log", and post the zip file, using the forum's Attachments tab. (Configure your host OS to show all extensions so you can find the "vbox.log", not "vbox.log.1", etc.)
Thanks

I'll perform the test as advised together with the similar problem on my another posting.

Please explain;

Code: Select all

Configure your host OS to show all extensions so you can find the "vbox.log", not "vbox.log.1", etc
Regards
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Files sharing btw Ubuntu host and Kubuntu vm

Post by scottgus1 »

Same answer as in your other topic.
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: Files sharing btw Ubuntu host and Kubuntu vm

Post by satimis »

Hi scottgus1,

Perform steps as advised. The log file is attached here.

Regards
VBox_ku.log.zip
(41.78 KiB) Downloaded 62 times
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: Files sharing btw Ubuntu host and Kubuntu vm

Post by satimis »

Hi scottgus1

Kubuntu2204301 VM

Sorry I forgot to inform you following steps which have to be executed after starting up Kubuntu2204301 VM:

On Konsole run;

Code: Select all

$ sudo mount -t vboxsf Transfer_Folder ~/sharefolder
(remark:
sharefolder(folder) was created on the VM previously)

then Kubuntu2204301 VM can connect Host's Transfer_Folder

Pls refer to following screenshots attached here:-
screenshot_ku2204301-1_10
screenshot_ku2204301-2_10
screenshot_ku2204301-3_10

I forgot;
Is it /etc/rc.local file which would execute its commands once at startup of the VM ?

If YES
I would create this file and put on it;

Code: Select all

sudo mount -t vboxsf Transfer_Folder ~/sharefolder
So the Transfer folder of the Host will be connected automatically.

Regards
Attachments
screenshot_ku2204301-1_10.png
screenshot_ku2204301-1_10.png (23.2 KiB) Viewed 2011 times
screenshot_ku2204301-2_10.png
screenshot_ku2204301-2_10.png (12.38 KiB) Viewed 2011 times
screenshot_ku2204301-3_10.png
screenshot_ku2204301-3_10.png (27.43 KiB) Viewed 2011 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Files sharing btw Ubuntu host and Kubuntu vm

Post by scottgus1 »

The log provided was "Vbox.log.1", which is the second newest log. "Vbox.log" is the newest log. Do you have a text file in the Logs folder called "Vbox"? If so, your host is still lying to you about extensions.

The screenshots are unreadable. Screenshots are only usable if they can be read.

The Extension Pack is out of date, though that is not causing this problem. Guest Additions are installed:
00:00:01.205874 VirtualBox VM 7.0.10 r158379 linux.amd64 (Jul 12 2023 20:01:58) release log
00:00:01.214919 Installed Extension Packs:
00:00:01.214947 Oracle VM VirtualBox Extension Pack (Version: 7.0.8 r156879; VRDE Module: VBoxVRDP; Crypto Module: VBoxPuelCrypto)
00:00:10.651992 VMMDev: Guest Additions information report: Version 7.0.10 r158379 '7.0.10'
00:00:10.666739 VMMDev: Guest Log: vboxguest: Successfully loaded version 7.0.10 r158379
The Virtualbox Shared Folder is being set up:
00:00:01.535730 Host path '/home/satimis/Transfer_Folder', map name 'Transfer_Folder', writable, automount=true, automntpnt=, create_symlinks=false, missing=false
Apparently it is automounting, so manual mounting commands inside the VM OS should not be necessary. According to the manual https://www.virtualbox.org/manual/ch04. ... mount_auto
Folders are mounted under the /media directory. The folder name is normalized (no spaces, slashes or colons) and is prefixed with sf_.
You should try looking in /media/sf_Transfer_Folder.

I don't know if enabling automounting and not providing an automount point is correct or not.

Also,
For Linux and Oracle Solaris guests, access is restricted to members of the group vboxsf and the root user.
Is your Linux OS user a mamner of the vboxsf group?

I don't see any problems in the log about trouble using the shared folder.

Based on both topics, this and viewtopic.php?p=544178#p544178 , I think this is a permissions problem on the host. A Linux guru may be needed to suggest diagnostic steps.
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: Files sharing btw Ubuntu host and Kubuntu vm

Post by satimis »

Hi scottgus1

Problem solved with following steps:

On Kubuntu2204301 VM Konsole

$ sudo nano /etc/rc.local

Add following content on it

Code: Select all

#!/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.

mount -t vboxsf Transfer_Folder /home/satimis/sharefolder

exit 0
save rc.local

Again on Konsole run;

Code: Select all

$ sudo chmod +x /etc/rc.local
Reboot VM

Now this time the Transfer folder of the Host will be automatically connected. File sharing between Host and VM works without problem.

I have performed these steps long time ago to setup file sharing between Host and VM. I almost forgot.

If I recall correctly at that time the VMs were Gentoo and Fedora

Now leaving behind unsolved is file sharing btw Linux Host and Windows VM. Could we solve the problem in VirtualBox, instead of running Samba.

Regards
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Files sharing btw Ubuntu host and Kubuntu vm

Post by scottgus1 »

satimis wrote: 5. Dec 2023, 18:48 $ sudo nano /etc/rc.local

Add following content on it

Code: Select all

mount -t vboxsf Transfer_Folder /home/satimis/sharefolder
Sounds like the automount function wasn't completing. Maybe because the Auto mount point wasn't specified in the Virtualbox Shared Folder settings?

That it's working now with this manual mount command shows the host permissions may not be the problem.

**********************
satimis wrote: 5. Dec 2023, 18:48 Now leaving behind unsolved is file sharing btw Linux Host and Windows VM. Could we solve the problem in VirtualBox, instead of running Samba.
Only pertinent on the other topic, not this one.
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: Files sharing btw Ubuntu host and Kubuntu vm

Post by satimis »

Auto mount now works on starting the VM
Post Reply