Shared folder looks empty after mounting

Discussions about using Linux guests in VirtualBox.

Shared folder looks empty after mounting

Postby senglory » 31. Aug 2021, 16:32

Guest - Slackware 14.2, installed Guest Additions CD. Host - Win 10. When I open my shared folder in the guest I see it's empty (see the screenshot). the root folder of host drive С is of course full of different files and folders. What should I do to have my folder /media/sf_C_DRIVE showing full content of the mapped drive?
Attachments
VBOX - Shared Folder 2.jpg
VBOX - Shared Folder 2.jpg (103.42 KiB) Viewed 7175 times
senglory
 
Posts: 9
Joined: 31. Aug 2021, 15:36

Re: Shared folder looks empty after mounting

Postby scottgus1 » 31. Aug 2021, 17:48

Start the VM from full power off, not save-state. Run until you see the problem happen, then shut down the VM from within the VM OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Please right-click the VM in the main Virtualbox window's VM list, choose Show Log. Save the far left tab's log, zip the log file, and post the zip file, using the forum's Upload Attachment tab.
scottgus1
Site Moderator
 
Posts: 14405
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared folder looks empty after mounting

Postby senglory » 31. Aug 2021, 20:19

Here's my VBox.log; if I understand you right, this was the "far left" log.
Attachments
VBox.log.zip
(29.81 KiB) Downloaded 3 times
senglory
 
Posts: 9
Joined: 31. Aug 2021, 15:36

Re: Shared folder looks empty after mounting

Postby scottgus1 » 31. Aug 2021, 20:24

Looks like the Guest Additions were not installed correctly:
00:00:22.547356 VMMDev: Guest Additions information report: Version 6.0.0 r127566 '6.0.0'

Either the CD was only inserted in the VM's CD drive (that's all the Devices menu's "Insert Guest Additions CD Image" does) or the Guest Additions did not install properly.

There are prerequisites for the GAs, please see https://www.virtualbox.org/manual/ch02. ... nux-prereq (GAs prereqs are the same as for Virtualbox on the host) then run the installer on the GAs CD in the VM's CD drive.

One other thing, though it may eventually work: sharing the root of a drive is not recommended by security experts, especially so not the boot drive of the host.
scottgus1
Site Moderator
 
Posts: 14405
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared folder looks empty after mounting

Postby senglory » 31. Aug 2021, 20:36

or the Guest Additions did not install properly.


Ok, how I'm supposed to have it fixed? I can go to /mnt/sr0 and what I'm supposed to run here?
Attachments
VBOX - Shared Folder 4.jpg
VBOX - Shared Folder 4.jpg (65.01 KiB) Viewed 7157 times
senglory
 
Posts: 9
Joined: 31. Aug 2021, 15:36

Re: Shared folder looks empty after mounting

Postby scottgus1 » 31. Aug 2021, 20:40

Not being a Linux guru, this is a rough guess, but I'd go with VboxLinuxAdditions.run.
scottgus1
Site Moderator
 
Posts: 14405
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared folder looks empty after mounting

Postby senglory » 31. Aug 2021, 21:03

Done. Here's my execution log:
root@porteus:/mnt/sr0# ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.26 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.1.26 of VirtualBox Guest Additions...
vboxadd-service.sh: Stopping VirtualBox Guest Addition service.
You may need to restart your guest system to finish removing guest drivers.
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
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: or
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Kernel headers not found for target kernel
5.12.14-porteus. Please install them and execute
/sbin/rcvboxadd setup
VirtualBox Guest Additions: Running kernel modules will not be replaced until
the system is restarted
Building the VirtualBox Guest Additions kernel modules. This may take a while.
To build modules for other installed kernels, run
/sbin/rcvboxadd quicksetup <version>
or
/sbin/rcvboxadd quicksetup all
Kernel headers not found for target kernel 5.12.14-porteus. Please install them
and execute
/sbin/rcvboxadd setup
Running kernel modules will not be replaced until the system is restarted
vboxadd-service.sh: Starting VirtualBox Guest Addition service.


Rebooted my VM - the shared folder /media/sf_C_DRIVE remains empty.
senglory
 
Posts: 9
Joined: 31. Aug 2021, 15:36

Re: Shared folder looks empty after mounting

Postby scottgus1 » 31. Aug 2021, 21:05

senglory wrote:VirtualBox Guest Additions: Kernel headers not found for target kernel

Did you run the prerequisites?
scottgus1
Site Moderator
 
Posts: 14405
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared folder looks empty after mounting

Postby senglory » 31. Aug 2021, 22:36

I had to go to ftp. vim. org / ftp /os /Linux /distr/porteus/x86_64/Porteus-v5.0/kernel/ and take proper XZM files from there. After that restarting of VboxLinuxAdditions.run followed by rebooting of VM I ultimately got the so long-waited С drive content in my shared folder :) Thanks!
senglory
 
Posts: 9
Joined: 31. Aug 2021, 15:36

Re: Shared folder looks empty after mounting

Postby scottgus1 » 31. Aug 2021, 22:56

Great! Glad you're up and running.
scottgus1
Site Moderator
 
Posts: 14405
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared folder looks empty after mounting

Postby senglory » 20. Nov 2021, 23:10

The issue's got back. Now it takes place with 32bit Linux and the freshmost guest additions. Here's the log:
Building the main Guest Additions 6.1.28 module for kernel 5.12.14-porteus.
Error building the module. Build output follows.
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/5.12.14-porteus/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j1 modules
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo >&2; \
echo >&2 " ERROR: Kernel configuration is invalid."; \
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo >&2 ; \
/bin/false)
make -f ./scripts/Makefile.build obj=/tmp/vbox.0 \
single-build= \
need-builtin=1 need-modorder=1
gcc -Wp,-MMD,/tmp/vbox.0/.VBoxGuest-linux.o.d -nostdinc -isystem /usr/lib/gcc/i586-slackware-linux/10.3.0/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m32 -msoft-float -mregparm=3 -freg-struct-return -fno-pic -mpreferred-stack-boundary=2 -march=i686 -Wa,-mtune=generic32 -ffreestanding -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -Os -fno-allow-store-data-races -Wframe-larger-than=1024 -fno-stack-protector -Wimplicit-fallthrough -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -Wno-declaration-after-statement -fno-pie -include /tmp/vbox.0/include/VBox/VBoxGuestMangling.h -I./include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DVBOX -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_GUEST -DIN_GUEST_R0 -DIN_MODULE -DRT_WITH_VBOX -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DRT_ARCH_X86 -DMODULE -DKBUILD_BASENAME='"VBoxGuest_linux"' -DKBUILD_MODNAME='"vboxguest"' -D__KBUILD_MODNAME=kmod_vboxguest -c -o /tmp/vbox.0/VBoxGuest-linux.o /tmp/vbox.0/VBoxGuest-linux.c
/bin/sh: line 1: scripts/basic/fixdep: cannot execute binary file: Exec format error
make[2]: *** [scripts/Makefile.build:271: /tmp/vbox.0/VBoxGuest-linux.o] Error 126
make[2]: *** Deleting file '/tmp/vbox.0/VBoxGuest-linux.o'
make[1]: *** [Makefile:1859: /tmp/vbox.0] Error 2
make: *** [/tmp/vbox.0/Makefile-footer.gmk:117: vboxguest] Error 2



What else does it want from me?
senglory
 
Posts: 9
Joined: 31. Aug 2021, 15:36

Re: Shared folder looks empty after mounting

Postby scottgus1 » 21. Nov 2021, 01:03

senglory wrote:echo >&2 " ERROR: Kernel configuration is invalid."; \

Looks like a bit more careful parsing of error messages is necessary. This appears to be the same problem as before.

senglory wrote:the freshmost guest additions.

Did you run the prereq's again?
scottgus1
Site Moderator
 
Posts: 14405
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared folder looks empty after mounting

Postby senglory » 25. Nov 2021, 22:07

Yes, I did it. But no luck, the explicit run of

Code: Select all   Expand viewCollapse view
make oldconfig && make prepare


produced the following:

root@porteus:/usr/src/linux# make oldconfig && make prepare
init/Kconfig:2039: can't open file "arch/Kconfig"
make[1]: *** [scripts/kconfig/Makefile:63: oldconfig] Error 1
make: *** [Makefile:602: oldconfig] Error 2


The folder "/usr/src/linux/arch" doesn't have the specified Kconfig, instead of it there's a x86 folder. What should I do to be able to run this command?
senglory
 
Posts: 9
Joined: 31. Aug 2021, 15:36

Re: Shared folder looks empty after mounting

Postby arQon » 2. Dec 2021, 10:27

scottgus1 wrote:
senglory wrote:echo >&2 " ERROR: Kernel configuration is invalid."; \

Looks like a bit more careful parsing of error messages is necessary. This appears to be the same problem as before.


Not quite. The echos aren't real: they're the end of an IF that says (A || echo "blah"). Logic optimisation in most languages (incl sh) is that if A is true B is not evaluated, because there's no need to do so: the end result is already guaranteed to be true.

In other words, writing "A || blahblah" in such languages really means "IF !A { blahblah }". shell programmers prefer the || form because if means they don't have to deal with adding ENDIFs all over the place. (and because making the code less obvious to uninitiated means better job security... :P)

Not really your fault, since the pasted output is pretty misleading, but in this case the trick is simple: the fact that you can see the ECHO statements means it's simply listing the CODE - NOT the output. If they HAD been executed, you'd see both the ECHOs themselves, AND then also the output "again". :)
arQon
 
Posts: 158
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: Shared folder looks empty after mounting

Postby scottgus1 » 3. Dec 2021, 01:45

Ah, yes, arQon, I see what you mean. Those 'echo's seemed odd to me too, but I'm no Linux guru... :lol:
scottgus1
Site Moderator
 
Posts: 14405
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux


Return to Linux Guests

Who is online

Users browsing this forum: Baidu [Spider], MatsBoekelund, pre2si and 20 guests