ivan-hc / VirtualBox-appimage

Unofficial VirtualBox KVM AppImage built on top of "Conty" (Arch Linux).
6 stars 2 forks source link

about usb driver #7

Closed qq895311511 closed 2 months ago

qq895311511 commented 2 months ago

Regarding the USB issue with VirtualBox, I believe it is a problem that needs to be addressed, rather than one that is unsolvable. I do not wish to give up on this issue due to its complexity, but rather, I hope to keep this issue on the table until a solution is found.

I currently have a potential solution in mind: after running create-archlinux, the terminal will be in the root user state. In this state, you can add the username and install the extension files, and then execute create-conty.sh. The reason for this is that some programs will only automatically generate some .so library files in the corresponding directories during the installation process.

Therefore, the USB driver issue needs to be kept open and actively pursued until a resolution can be achieved.

ivan-hc commented 2 months ago

I currently have a potential solution in mind: after running create-archlinux, the terminal will be in the root user state. In this state, you can add the username and install the extension files, and then execute create-conty.sh. The reason for this is that some programs will only automatically generate some .so library files in the corresponding directories during the installation process.

this workflow runs in github actions for portability reasons

I have already a code to add to install extension pack

# Add extension pack
wget https://download.virtualbox.org/virtualbox/"${vboxver}"/Oracle_VM_VirtualBox_Extension_Pack-"${vboxver}".vbox-extpack -O ./Extension_Pack.tar
mkdir -p shrunk
tar xfC ./Extension_Pack.tar shrunk
rm -r shrunk/{darwin*,solaris*,win*}
tar -c --gzip --file shrunk.vbox-extpack -C shrunk .
install -Dm 644 shrunk.vbox-extpack \
    "${bootstrap}"/usr/share/virtualbox/extensions/Oracle_VM_VirtualBox_Extension_Pack-"${vboxver}".vbox-extpack
install -Dm 644 shrunk/ExtPack-license.txt \
    "${bootstrap}"/usr/share/licenses/virtualbox-ext-oracle/PUEL

Extension pack will be integrated, but it will be still unusable.

I don't know if this is related to the different way VirtualBox is compiled.

Note that it does not use vboxdrv at all.

However, I think that the solution is elsewhere.

The script "conty-start.sh" contains some --bind-try options for bubblewrap. Conty is a container that uses bubblewrap to be interfaced with the host system.

Where the USB devices are listed? Maybe we need to bind-mount those directories.

In the meantime I'll search this among Conty issues.

However, since USB and other devices require a kernel to be used and the virtualbox-kvm developers are talking about "passthrough" (see https://github.com/cyberus-technology/virtualbox-kvm#usb-pass-through), the way USB works on this edition of VirtualBox shoul be totally different.

ivan-hc commented 2 months ago

@Kron4ek what do you think about?

Kron4ek commented 2 months ago

I have regular VirtualBox installed on the host system and in my case i have USB devices visible in your VirtualBox-appimage too, so they can work if the host system is properly configured.

https://github.com/cyberus-technology/virtualbox-kvm#usb-pass-through)

As written on this link, some actions need to be done on the host system, i think this can't be solved purely on the container side.

ivan-hc commented 2 months ago

I have regular VirtualBox installed on the host system and in my case i have USB devices visible in your VirtualBox-appimage too, so they can work if the host system is properly configured.

Regular installation brings with it "vboxdrv" and extension pack is not im my AppImage in this moment.

So if you remove VM from the host and reboot, and you use the AppImage, listed USB will disappear.

Kron4ek commented 2 months ago

It does not rely on vboxdrv, USB devices are visible even after unloading VirtualBox kernel modules.

# rmmod vboxnetflt vboxnetadp vboxdrv

Regular VirtualBox just breaks after that, VirtualBox-kvm works fine.

The important parts here are udev rules and vboxusers, not kernel modules.

ivan-hc commented 2 months ago

I have finally managed to use USB devices by manually installing/extracting extension pack

# Add extension pack
wget https://download.virtualbox.org/virtualbox/"${vboxver}"/Oracle_VM_VirtualBox_Extension_Pack-"${vboxver}".vbox-extpack -O ./Extension_Pack.tar
mkdir -p shrunk
tar xfC ./Extension_Pack.tar shrunk
rm -r shrunk/{darwin*,solaris*,win*}
tar -c --gzip --file shrunk.vbox-extpack -C shrunk .
install -Dm 644 shrunk.vbox-extpack \
    "${bootstrap}"/usr/share/virtualbox/extensions/Oracle_VM_VirtualBox_Extension_Pack-"${vboxver}".vbox-extpack
install -Dm 644 shrunk/ExtPack-license.txt \
    "${bootstrap}"/usr/share/licenses/virtualbox-ext-oracle/PUEL
mkdir -p "${bootstrap}"/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64
install -Dm 644 shrunk/* \
    "${bootstrap}"/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/
install -Dm 644 shrunk/linux.amd64/* \
    "${bootstrap}"/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64/

I need to test this without udev rules andvboxusers enabled, to see if we can prevent using additional configurations.

See you later.

ivan-hc commented 2 months ago

Works!

Istantanea_2024-08-06_17-17-21 png

No additional configurations are needed!

ivan-hc commented 2 months ago

Wait for the next release before updating. Its 20MB bigger.

ivan-hc commented 2 months ago

But wait a moment.

Have I got any risk by implementing Extension Pack?

It is under PUEL license https://www.virtualbox.org/wiki/VirtualBox_PUEL

@qq895311511 @Kron4ek @Samueru-sama

ivan-hc commented 2 months ago

up?

qq895311511 commented 2 months ago

up?

Hi, just I saw, you can do it. Great Please update new versions

qq895311511 commented 2 months ago

up?

And, the another issue I close, The cause is Gnome boxes need theme inside the share folder.

ivan-hc commented 2 months ago

up?

Hi, just I saw, you can do it. Great Please update new versions

I want to know what happens if I include these extensions, for legal reasons:

can I include these file protected by PUEL license without risks for me?

qq895311511 commented 2 months ago

up?

Hi, just I saw, you can do it. Great Please update new versions

I want to know what happens if I include these extensions, for legal reasons:

can I include these file protected by PUEL license without risks for me?

This is no problem. VirtualBox itself is an open source software. For the expansion package, as long as it is not for the purpose of transaction, it will not cause legal problems.

ivan-hc commented 2 months ago

Uhm... I can see my webcam but I can't see my USB device connected, also if I close virtualbox

Can you please test this too?

Maybe I should add 60-vboxusb.rules to /etc/udev in that case

qq895311511 commented 2 months ago

Uhm... I can see my webcam but I can't see my USB device connected, also if I close virtualbox

Can you please test this too?

Maybe I should add 60-vboxusb.rules to /etc/udev in that case

currently, yes, i test too, i have same problem, @ivan-hc Peek 2024-08-07 00-58

qq895311511 commented 2 months ago

Uhm... I can see my webcam but I can't see my USB device connected, also if I close virtualbox

Can you please test this too?

Maybe I should add 60-vboxusb.rules to /etc/udev in that case

i can see my webcam , but the usb driver cannot be detected

ivan-hc commented 2 months ago

I'll do a quick test with udev rules

ivan-hc commented 2 months ago

No way!

I've also followed instructions here https://github.com/cyberus-technology/virtualbox-kvm#usb-pass-through

Being the udev configuration file added on the host, I also used --bind to add configuration file to the guest machine.

I'll try to add it manually directly in Conty.

@Kron4ek how should I extract conty?

qq895311511 commented 2 months ago

No way!

I've also followed instructions here https://github.com/cyberus-technology/virtualbox-kvm#usb-pass-through

Being the udev configuration file added on the host, I also used --bind to add configuration file to the guest machine.

I'll try to add it manually directly in Conty.

@Kron4ek how should I extract conty?

For now it's only possible to extract (via -e launch argument), recompression is not implemented.

ivan-hc commented 2 months ago

and how should I launch the extracted conty directory?

Kron4ek commented 2 months ago

You don't need to add udev rules to Conty, they are for the host.

ivan-hc commented 2 months ago

You don't need to add udev rules to Conty, they are for the host.

so we can't do anything then

ivan-hc commented 2 months ago

@Kron4ek can you provide the list of files installed in /usr/lib/virtualbox and its subdirectories?

Maybe something is gone wrong when I installed the extension pack

# Add extension pack
wget https://download.virtualbox.org/virtualbox/"${vboxver}"/Oracle_VM_VirtualBox_Extension_Pack-"${vboxver}".vbox-extpack -O ./Extension_Pack.tar
mkdir -p shrunk
tar xfC ./Extension_Pack.tar shrunk
rm -r shrunk/{darwin*,solaris*,win*}
tar -c --gzip --file shrunk.vbox-extpack -C shrunk .
install -Dm 644 shrunk.vbox-extpack \
    "${bootstrap}"/usr/share/virtualbox/extensions/Oracle_VM_VirtualBox_Extension_Pack-"${vboxver}".vbox-extpack
install -Dm 644 shrunk/ExtPack-license.txt \
    "${bootstrap}"/usr/share/licenses/virtualbox-ext-oracle/PUEL
mkdir -p "${bootstrap}"/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64
install -Dm 644 shrunk/* \
    "${bootstrap}"/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/
install -Dm 644 shrunk/linux.amd64/* \
    "${bootstrap}"/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64/

to create this script I've followed the instructions from the PKGBUILD of https://aur.archlinux.org/packages/virtualbox-ext-oracle and added the missing steps to manually install the needed files


How to extract Extension pack manually

The version of Vbox used in this AppImage come from this variable

vboxver=$(curl -Ls https://gitlab.com/chaotic-aur/pkgbuilds/-/raw/main/virtualbox-kvm/PKGBUILD | grep vboxver | head -1 | tr "'" '\n' | grep "^[0-9]")

we need to download the correct extension pack and convert it to a .tar package to easily extract it with tar

we will save the content into a directory I've named the same way it is named in the PKGBUILD, "shrunk"

wget https://download.virtualbox.org/virtualbox/"${vboxver}"/Oracle_VM_VirtualBox_Extension_Pack-"${vboxver}".vbox-extpack -O ./Extension_Pack.tar
mkdir -p shrunk
tar xfC ./Extension_Pack.tar shrunk

the PXGBUILD contains steps to remove unneeded files from the extension pack and then repacks it to put it in /usr/share

rm -r shrunk/{darwin*,solaris*,win*}
tar -c --gzip --file shrunk.vbox-extpack -C shrunk .
install -Dm 644 shrunk.vbox-extpack \
    "${bootstrap}"/usr/share/virtualbox/extensions/Oracle_VM_VirtualBox_Extension_Pack-"${vboxver}".vbox-extpack
install -Dm 644 shrunk/ExtPack-license.txt \
    "${bootstrap}"/usr/share/licenses/virtualbox-ext-oracle/PUEL

these steps are all the PKGBUILD adds, because you can get the prompt to accept PUEL license.

What I added

the following steps are needed to place all packages to the dedicated directories

mkdir -p "${bootstrap}"/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64
install -Dm 644 shrunk/* \
    "${bootstrap}"/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/
install -Dm 644 shrunk/linux.amd64/* \
    "${bootstrap}"/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64/

NOTE that /usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack and its subdirectory linux.amd64 does not exist.

Now, the latter contains a series of libraries and binaries.

I'm not sure if all of these files must be placed in that directory or some of them need to be in /usr/lib/virtualbox

As you know, its enough to check the mounted conty directory in tmp to see what is included in Conty.

Please, let me know if you see differences betweeen the VB installed on the host and the AppImage.

NOTE, this is VirtualBox KMV, it does not require vbodrv installed, so no dkms/modules loaded.

If you are looking to a "stock" attempt of porting VirtualBox, the upstream one, to Conty, check this other directory of my repo:

https://github.com/ivan-hc/VirtualBox-appimage/tree/main/upstream-vb-builders

@qq895311511 @Samueru-sama you can check it as well, maybe you are luckier than me.

Kron4ek commented 2 months ago
$ ls -Rl /usr/lib/virtualbox
/usr/lib/virtualbox:
total 155964
-rwxr-xr-x 1 root root   460776 Jul 16 19:28 DbgPlugInDiggers.so
drwxr-xr-x 2 root root     4096 May  3 20:47 ExtensionPacks
-rwxr-xr-x 1 root root 28844128 Jul 16 19:28 UICommon.so
-rwxr-xr-x 1 root root    14320 Jul 16 19:28 VBoxAuth.so
-rwxr-xr-x 1 root root    47136 Jul 16 19:28 VBoxAuthSimple.so
-rwxr-xr-x 1 root root   199232 Jul 16 19:28 VBoxBalloonCtrl
-rwxr-xr-x 1 root root  3427968 Jul 16 19:28 VBoxDD.so
-rwxr-xr-x 1 root root  8750808 Jul 16 19:28 VBoxDD2.so
-rw-r--r-- 1 root root   310096 Jul 16 19:28 VBoxDDR0.r0
-rwxr-xr-x 1 root root   519576 Jul 16 19:28 VBoxDDU.so
-rwxr-xr-x 1 root root   159736 Jul 16 19:28 VBoxDbg.so
-rwxr-xr-x 1 root root    38952 Jul 16 19:28 VBoxDragAndDropSvc.so
-rwxr-xr-x 1 root root  2510032 Jul 16 19:28 VBoxDxVk.so
-rw-r--r-- 1 root root  4194304 Jul 16 19:28 VBoxEFI32.fd
-rw-r--r-- 1 root root  4194304 Jul 16 19:28 VBoxEFI64.fd
-rwxr-xr-x 1 root root    63792 Jul 16 19:28 VBoxExtPackHelperApp
-rwxr-xr-x 1 root root    34872 Jul 16 19:28 VBoxGuestControlSvc.so
-rwxr-xr-x 1 root root    43056 Jul 16 19:28 VBoxGuestPropSvc.so
-rwsr-xr-x 1 root root   166016 Jul 16 19:28 VBoxHeadless
-rwxr-xr-x 1 root root   133160 Jul 16 19:28 VBoxHeadless.so
-rwxr-xr-x 1 root root    18400 Jul 16 19:28 VBoxHostChannel.so
-rwxr-xr-x 1 root root    78080 Jul 16 19:28 VBoxKeyboard.so
-rwxr-xr-x 1 root root  3161368 Jul 16 19:28 VBoxManage
-rwsr-xr-x 1 root root    35040 Jul 16 19:28 VBoxNetAdpCtl
-rwsr-xr-x 1 root root   166016 Jul 16 19:28 VBoxNetDHCP
-rwxr-xr-x 1 root root   284744 Jul 16 19:28 VBoxNetDHCP.so
-rwsr-xr-x 1 root root   166016 Jul 16 19:28 VBoxNetNAT
-rwxr-xr-x 1 root root   350504 Jul 16 19:28 VBoxNetNAT.so
-rwxr-xr-x 1 root root   251800 Jul 16 19:28 VBoxPython3.so
-rwxr-xr-x 1 root root   251800 Jul 16 19:28 VBoxPython3m.so
-rwxr-xr-x 1 root root  3751904 Jul 16 19:28 VBoxRT.so
-rwsr-xr-x 1 root root   166008 Jul 16 19:28 VBoxSDL
-rwxr-xr-x 1 root root   202824 Jul 16 19:28 VBoxSDL.so
-rwxr-xr-x 1 root root 10098184 Jul 16 19:28 VBoxSVC
-rwxr-xr-x 1 root root   624936 Jul 16 19:28 VBoxSVGA3D.so
-rwxr-xr-x 1 root root    71632 Jul 16 19:28 VBoxSharedClipboard.so
-rwxr-xr-x 1 root root    75720 Jul 16 19:28 VBoxSharedFolders.so
-rwxr-xr-x 1 root root    72400 Jul 16 19:28 VBoxTestOGL
-rwxr-xr-x 1 root root  6297384 Jul 16 19:28 VBoxVMM.so
-rwxr-xr-x 1 root root    14352 Jul 16 19:28 VBoxVMMPreload.so
-rwxr-xr-x 1 root root  1471960 Jul 16 19:28 VBoxXPCOM.so
-rwxr-xr-x 1 root root    51232 Jul 16 19:28 VBoxXPCOMC.so
-rwxr-xr-x 1 root root    35032 Jul 16 19:28 VBoxXPCOMIPCD
-rw-r--r-- 1 root root  2739992 Jul 16 19:28 VMMR0.r0
-rwxr-xr-x 1 root root  3068872 Jul 16 19:28 VirtualBox
-rwsr-xr-x 1 root root   166016 Jul 16 19:28 VirtualBoxVM
-rwxr-xr-x 1 root root  1317264 Jul 16 19:28 VirtualBoxVM.so
drwxr-xr-x 2 root root     4096 Jul 16 23:23 components
-rwxr-xr-x 1 root root   145536 Jul 16 19:28 libvboxjxpcom.so
-rwxr-xr-x 1 root root   494408 Jul 16 19:28 vbox-img
-rwxr-xr-x 1 root root   146232 Jul 16 19:28 vboximg-mount
-rwxr-xr-x 1 root root 38936856 Jul 16 19:28 vboxwebsrv
-rwxr-xr-x 1 root root 30783904 Jul 16 19:28 webtest

/usr/lib/virtualbox/ExtensionPacks:
total 0

/usr/lib/virtualbox/components:
total 17048
-rwxr-xr-x 1 root root 5035104 Jul 16 19:28 VBoxC.so
-rwxr-xr-x 1 root root  519472 Jul 16 19:28 VBoxDDU.so
-rwxr-xr-x 1 root root 3751800 Jul 16 19:28 VBoxRT.so
-rwxr-xr-x 1 root root   18536 Jul 16 19:28 VBoxSVCM.so
-rwxr-xr-x 1 root root 6297280 Jul 16 19:28 VBoxVMM.so
-rwxr-xr-x 1 root root 1471856 Jul 16 19:28 VBoxXPCOM.so
-rwxr-xr-x 1 root root   25931 Jul 16 19:28 VBoxXPCOMBase.xpt
-rwxr-xr-x 1 root root  166264 Jul 16 19:28 VBoxXPCOMIPCC.so
-rwxr-xr-x 1 root root  154152 Jul 16 19:28 VirtualBox_XPCOM.xpt
ivan-hc commented 2 months ago

sorry for the late reply, @Kron4ek I have seen that you have not the Extension Pack. Its strange.

This is the content of the same path in the AppImage right now

$ ls -Rl .
.:
totale 152305
drwxr-xr-x 1 root root        1  6 ago 21.34 additions
drwxr-xr-x 1 root root        5  6 ago 21.34 components
-rwxr-xr-x 1 root root   436088 18 giu 21.30 DbgPlugInDiggers.so
drwxr-xr-x 1 root root        1  6 ago 21.34 ExtensionPacks
-rwxr-xr-x 1 root root   137232 18 giu 21.30 libvboxjxpcom.so
drwxr-xr-x 1 root root       81  6 ago 21.34 nls
-rwxr-xr-x 1 root root 28856320 18 giu 21.30 UICommon.so
-rwxr-xr-x 1 root root    38832 18 giu 21.30 VBoxAuthSimple.so
-rwxr-xr-x 1 root root    14216 18 giu 21.30 VBoxAuth.so
-rwxr-xr-x 1 root root   186840 18 giu 21.30 VBoxBalloonCtrl
-rwxr-xr-x 1 root root   155536 18 giu 21.30 VBoxDbg.so
-rwxr-xr-x 1 root root  8754800 18 giu 21.30 VBoxDD2.so
-rw-r--r-- 1 root root   310096 18 giu 21.30 VBoxDDR0.r0
-rwxr-xr-x 1 root root  3022368 18 giu 21.30 VBoxDD.so
-rwxr-xr-x 1 root root   470320 18 giu 21.30 VBoxDDU.so
-rwxr-xr-x 1 root root    38840 18 giu 21.30 VBoxDragAndDropSvc.so
-rwxr-xr-x 1 root root  2296936 18 giu 21.30 VBoxDxVk.so
-rw-r--r-- 1 root root  4194304 18 giu 21.30 VBoxEFI32.fd
-rw-r--r-- 1 root root  4194304 18 giu 21.30 VBoxEFI64.fd
-rwxr-xr-x 1 root root    63680 18 giu 21.30 VBoxExtPackHelperApp
-rwxr-xr-x 1 root root    30656 18 giu 21.30 VBoxGuestControlSvc.so
-rwxr-xr-x 1 root root    42944 18 giu 21.30 VBoxGuestPropSvc.so
-rwxr-xr-x 1 root root   120952 18 giu 21.30 VBoxHeadless
-rwxr-xr-x 1 root root    18288 18 giu 21.30 VBoxHostChannel.so
-rwxr-xr-x 1 root root   453344 18 giu 21.30 vbox-img
-rwxr-xr-x 1 root root   129744 18 giu 21.30 vboximg-mount
-rwxr-xr-x 1 root root    77968 18 giu 21.30 VBoxKeyboard.so
-rwxr-xr-x 1 root root  3030192 18 giu 21.30 VBoxManage
-rwxr-xr-x 1 root root    30840 18 giu 21.30 VBoxNetAdpCtl
-rwxr-xr-x 1 root root   268440 18 giu 21.30 VBoxNetDHCP
-rwxr-xr-x 1 root root   297336 18 giu 21.30 VBoxNetNAT
-rwxr-xr-x 1 root root  3428216 18 giu 21.30 VBoxRT.so
-rwxr-xr-x 1 root root   186528 18 giu 21.30 VBoxSDL
-rwxr-xr-x 1 root root    63320 18 giu 21.30 VBoxSharedClipboard.so
-rwxr-xr-x 1 root root    67416 18 giu 21.30 VBoxSharedFolders.so
-rwxr-xr-x 1 root root  9201760 18 giu 21.30 VBoxSVC
-rwxr-xr-x 1 root root   248000 18 giu 21.30 VBoxSVGA3D.so
-rwxr-xr-x 1 root root    72296 18 giu 21.30 VBoxTestOGL
-rwxr-xr-x 1 root root  6063808 18 giu 21.30 VBoxVMM.so
-rwxr-xr-x 1 root root 39182536 18 giu 21.30 vboxwebsrv
-rwxr-xr-x 1 root root    51128 18 giu 21.30 VBoxXPCOMC.so
-rwxr-xr-x 1 root root    34928 18 giu 21.30 VBoxXPCOMIPCD
-rwxr-xr-x 1 root root  1279344 18 giu 21.30 VBoxXPCOM.so
-rwxr-xr-x 1 root root  3056440 18 giu 21.30 VirtualBox
-rwxr-xr-x 1 root root  1329528 18 giu 21.30 VirtualBoxVM
-rw-r--r-- 1 root root  2744088 18 giu 21.30 VMMR0.r0
-rwxr-xr-x 1 root root 31267160 18 giu 21.30 webtest

./additions:
totale 51648
-rw-r--r-- 1 root root 52887552  2 mag 13.59 VBoxGuestAdditions.iso

./components:
totale 4879
-rwxr-xr-x 1 root root 4642112 18 giu 21.30 VBoxC.so
-rwxr-xr-x 1 root root   18432 18 giu 21.30 VBoxSVCM.so
-rwxr-xr-x 1 root root   25931 18 giu 21.30 VBoxXPCOMBase.xpt
-rwxr-xr-x 1 root root  153864 18 giu 21.30 VBoxXPCOMIPCC.so
-rwxr-xr-x 1 root root  154291 18 giu 21.30 VirtualBox_XPCOM.xpt

./ExtensionPacks:
totale 1
drwxr-xr-x 1 root root 8  6 ago 21.34 Oracle_VM_VirtualBox_Extension_Pack

./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack:
totale 117
-rw-r--r-- 1 root root 10965  6 ago 21.34 ExtPack-license.html
-rw-r--r-- 1 root root 19907  6 ago 21.34 ExtPack-license.rtf
-rw-r--r-- 1 root root 10357  6 ago 21.34 ExtPack-license.txt
-rw-r--r-- 1 root root 25806  6 ago 21.34 ExtPack.manifest
-rw-r--r-- 1 root root     6  6 ago 21.34 ExtPack.signature
-rw-r--r-- 1 root root   609  6 ago 21.34 ExtPack.xml
drwxr-xr-x 1 root root    10  6 ago 21.34 linux.amd64
-rw-r--r-- 1 root root 49152  6 ago 21.34 PXE-Intel.rom

./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64:
totale 8462
-rw-r--r-- 1 root root  481696  6 ago 21.34 VBoxHostWebcam.so
-rw-r--r-- 1 root root   14016  6 ago 21.34 VBoxNvmeR0.r0
-rw-r--r-- 1 root root   59608  6 ago 21.34 VBoxNvmeR3.so
-rw-r--r-- 1 root root   31168  6 ago 21.34 VBoxPuelCrypto.so
-rw-r--r-- 1 root root 7089536  6 ago 21.34 VBoxPuelMain.so
-rw-r--r-- 1 root root   14200  6 ago 21.34 VBoxPuelMainVM.so
-rw-r--r-- 1 root root   61160  6 ago 21.34 VBoxUsbCardReaderR3.so
-rw-r--r-- 1 root root   68288  6 ago 21.34 VBoxUsbWebcamR3.so
-rw-r--r-- 1 root root  824312  6 ago 21.34 VBoxVRDP.so
-rw-r--r-- 1 root root   18792  6 ago 21.34 VDPluginCrypt.so

./nls:
totale 17633
-rwxr-xr-x 1 root root 149962 18 giu 21.30 qt_bg.qm
-rwxr-xr-x 1 root root 208109 18 giu 21.30 qt_ca.qm
-rwxr-xr-x 1 root root 208346 18 giu 21.30 qt_ca_VA.qm
-rwxr-xr-x 1 root root 145942 18 giu 21.30 qt_cs.qm
-rwxr-xr-x 1 root root 174610 18 giu 21.30 qt_da.qm
-rwxr-xr-x 1 root root 218466 18 giu 21.30 qt_de.qm
-rwxr-xr-x 1 root root   1472 18 giu 21.30 qt_el.qm
-rwxr-xr-x 1 root root     30 18 giu 21.30 qt_en.qm
-rwxr-xr-x 1 root root 149374 18 giu 21.30 qt_es.qm
-rwxr-xr-x 1 root root   1470 18 giu 21.30 qt_eu.qm
-rwxr-xr-x 1 root root  93756 18 giu 21.30 qt_fa.qm
-rwxr-xr-x 1 root root 169389 18 giu 21.30 qt_fi.qm
-rwxr-xr-x 1 root root 148920 18 giu 21.30 qt_fr.qm
-rwxr-xr-x 1 root root 103922 18 giu 21.30 qt_gl.qm
-rwxr-xr-x 1 root root 125869 18 giu 21.30 qt_he.qm
-rwxr-xr-x 1 root root 197978 18 giu 21.30 qt_hr_HR.qm
-rwxr-xr-x 1 root root 145030 18 giu 21.30 qt_hu.qm
-rwxr-xr-x 1 root root 138260 18 giu 21.30 qt_id.qm
-rwxr-xr-x 1 root root 208949 18 giu 21.30 qt_it.qm
-rwxr-xr-x 1 root root 117880 18 giu 21.30 qt_ja.qm
-rwxr-xr-x 1 root root 130498 18 giu 21.30 qt_ka.qm
-rwxr-xr-x 1 root root     33 18 giu 21.30 qt_km_KH.qm
-rwxr-xr-x 1 root root 155589 18 giu 21.30 qt_ko.qm
-rwxr-xr-x 1 root root  87214 18 giu 21.30 qt_lt.qm
-rwxr-xr-x 1 root root   2584 18 giu 21.30 qt_nl.qm
-rwxr-xr-x 1 root root 156181 18 giu 21.30 qt_pl.qm
-rwxr-xr-x 1 root root 146709 18 giu 21.30 qt_pt_BR.qm
-rwxr-xr-x 1 root root  68185 18 giu 21.30 qt_pt.qm
-rwxr-xr-x 1 root root     37 18 giu 21.30 qt_ro.qm
-rwxr-xr-x 1 root root 201974 18 giu 21.30 qt_ru.qm
-rwxr-xr-x 1 root root 111754 18 giu 21.30 qt_sk.qm
-rwxr-xr-x 1 root root  93111 18 giu 21.30 qt_sl.qm
-rwxr-xr-x 1 root root     44 18 giu 21.30 qt_sr.qm
-rwxr-xr-x 1 root root  45177 18 giu 21.30 qt_sv.qm
-rwxr-xr-x 1 root root   1624 18 giu 21.30 qt_th.qm
-rwxr-xr-x 1 root root 192977 18 giu 21.30 qt_tr.qm
-rwxr-xr-x 1 root root 143295 18 giu 21.30 qt_uk.qm
-rwxr-xr-x 1 root root  61443 18 giu 21.30 qt_zh_CN.qm
-rwxr-xr-x 1 root root 120698 18 giu 21.30 qt_zh_TW.qm
-rwxr-xr-x 1 root root 250630 18 giu 21.30 VBoxManageNls_ru.qm
-rwxr-xr-x 1 root root 350910 18 giu 21.30 VirtualBoxAPI_ru.qm
-rwxr-xr-x 1 root root 330106 18 giu 21.30 VirtualBoxAPI_tr.qm
-rwxr-xr-x 1 root root 282133 18 giu 21.30 VirtualBox_bg.qm
-rwxr-xr-x 1 root root 410640 18 giu 21.30 VirtualBox_ca.qm
-rwxr-xr-x 1 root root 196005 18 giu 21.30 VirtualBox_ca_VA.qm
-rwxr-xr-x 1 root root 252772 18 giu 21.30 VirtualBox_cs.qm
-rwxr-xr-x 1 root root 301601 18 giu 21.30 VirtualBox_da.qm
-rwxr-xr-x 1 root root 568558 18 giu 21.30 VirtualBox_de.qm
-rwxr-xr-x 1 root root 375053 18 giu 21.30 VirtualBox_el.qm
-rwxr-xr-x 1 root root   4420 18 giu 21.30 VirtualBox_en.qm
-rwxr-xr-x 1 root root 576688 18 giu 21.30 VirtualBox_es.qm
-rwxr-xr-x 1 root root 273691 18 giu 21.30 VirtualBox_eu.qm
-rwxr-xr-x 1 root root 287040 18 giu 21.30 VirtualBox_fa.qm
-rwxr-xr-x 1 root root  90636 18 giu 21.30 VirtualBox_fi.qm
-rwxr-xr-x 1 root root 364856 18 giu 21.30 VirtualBox_fr.qm
-rwxr-xr-x 1 root root 101688 18 giu 21.30 VirtualBox_gl.qm
-rwxr-xr-x 1 root root  59458 18 giu 21.30 VirtualBox_he.qm
-rwxr-xr-x 1 root root 553371 18 giu 21.30 VirtualBox_hr_HR.qm
-rwxr-xr-x 1 root root 386124 18 giu 21.30 VirtualBox_hu.qm
-rwxr-xr-x 1 root root 552256 18 giu 21.30 VirtualBox_id.qm
-rwxr-xr-x 1 root root 583718 18 giu 21.30 VirtualBox_it.qm
-rwxr-xr-x 1 root root 427916 18 giu 21.30 VirtualBox_ja.qm
-rwxr-xr-x 1 root root 318190 18 giu 21.30 VirtualBox_ka.qm
-rwxr-xr-x 1 root root 110160 18 giu 21.30 VirtualBox_km_KH.qm
-rwxr-xr-x 1 root root 425070 18 giu 21.30 VirtualBox_ko.qm
-rwxr-xr-x 1 root root 187369 18 giu 21.30 VirtualBox_lt.qm
-rwxr-xr-x 1 root root 567484 18 giu 21.30 VirtualBox_nl.qm
-rwxr-xr-x 1 root root 389670 18 giu 21.30 VirtualBox_pl.qm
-rwxr-xr-x 1 root root 577366 18 giu 21.30 VirtualBox_pt_BR.qm
-rwxr-xr-x 1 root root 187519 18 giu 21.30 VirtualBox_pt.qm
-rwxr-xr-x 1 root root  89965 18 giu 21.30 VirtualBox_ro.qm
-rwxr-xr-x 1 root root 560105 18 giu 21.30 VirtualBox_ru.qm
-rwxr-xr-x 1 root root 128694 18 giu 21.30 VirtualBox_sk.qm
-rwxr-xr-x 1 root root 309755 18 giu 21.30 VirtualBox_sl.qm
-rwxr-xr-x 1 root root 133554 18 giu 21.30 VirtualBox_sr.qm
-rwxr-xr-x 1 root root 193658 18 giu 21.30 VirtualBox_sv.qm
-rwxr-xr-x 1 root root 261952 18 giu 21.30 VirtualBox_th.qm
-rwxr-xr-x 1 root root 554473 18 giu 21.30 VirtualBox_tr.qm
-rwxr-xr-x 1 root root 265736 18 giu 21.30 VirtualBox_uk.qm
-rwxr-xr-x 1 root root 378575 18 giu 21.30 VirtualBox_zh_CN.qm
-rwxr-xr-x 1 root root 387230 18 giu 21.30 VirtualBox_zh_TW.qm

all of you can do the same by launching the AppImage.

So, the answer is somewhere else?

I have an USB WebCam, and the Extension pack brings with it "VBoxHostWebcam.so" that is responsible of the screenshot I added above.

The directory "nls" is normally in /usr/share/virtualbox, but this release is virtualbox-kvm, and to enable languages, require that the directory is placed in /usr/lib/virtualbox instead.

This is what my log means.

So, if you are able to launch VirtualBox with USB support and without the Extension Pack, the answer is somewhere else.

ivan-hc commented 2 months ago

Difference between our /usr/lib/virtualbox/components: @Kron4ek

/usr/lib/virtualbox/components:
total 17048
-rwxr-xr-x 1 root root 5035104 Jul 16 19:28 VBoxC.so
-rwxr-xr-x 1 root root  519472 Jul 16 19:28 VBoxDDU.so
-rwxr-xr-x 1 root root 3751800 Jul 16 19:28 VBoxRT.so
-rwxr-xr-x 1 root root   18536 Jul 16 19:28 VBoxSVCM.so
-rwxr-xr-x 1 root root 6297280 Jul 16 19:28 VBoxVMM.so
-rwxr-xr-x 1 root root 1471856 Jul 16 19:28 VBoxXPCOM.so
-rwxr-xr-x 1 root root   25931 Jul 16 19:28 VBoxXPCOMBase.xpt
-rwxr-xr-x 1 root root  166264 Jul 16 19:28 VBoxXPCOMIPCC.so
-rwxr-xr-x 1 root root  154152 Jul 16 19:28 VirtualBox_XPCOM.xpt

the AppImage

./components:
totale 4879
-rwxr-xr-x 1 root root 4642112 18 giu 21.30 VBoxC.so
-rwxr-xr-x 1 root root   18432 18 giu 21.30 VBoxSVCM.so
-rwxr-xr-x 1 root root   25931 18 giu 21.30 VBoxXPCOMBase.xpt
-rwxr-xr-x 1 root root  153864 18 giu 21.30 VBoxXPCOMIPCC.so
-rwxr-xr-x 1 root root  154291 18 giu 21.30 VirtualBox_XPCOM.xpt

ours is smaller. What are these files?

ivan-hc commented 2 months ago

I'm looking for important differences between our installations.

Your main directory

-rwxr-xr-x 1 root root   460776 Jul 16 19:28 DbgPlugInDiggers.so
drwxr-xr-x 2 root root     4096 May  3 20:47 ExtensionPacks
-rwxr-xr-x 1 root root 28844128 Jul 16 19:28 UICommon.so
-rwxr-xr-x 1 root root    14320 Jul 16 19:28 VBoxAuth.so
-rwxr-xr-x 1 root root    47136 Jul 16 19:28 VBoxAuthSimple.so
-rwxr-xr-x 1 root root   199232 Jul 16 19:28 VBoxBalloonCtrl
-rwxr-xr-x 1 root root  3427968 Jul 16 19:28 VBoxDD.so
-rwxr-xr-x 1 root root  8750808 Jul 16 19:28 VBoxDD2.so
-rw-r--r-- 1 root root   310096 Jul 16 19:28 VBoxDDR0.r0
-rwxr-xr-x 1 root root   519576 Jul 16 19:28 VBoxDDU.so
-rwxr-xr-x 1 root root   159736 Jul 16 19:28 VBoxDbg.so
-rwxr-xr-x 1 root root    38952 Jul 16 19:28 VBoxDragAndDropSvc.so
-rwxr-xr-x 1 root root  2510032 Jul 16 19:28 VBoxDxVk.so
-rw-r--r-- 1 root root  4194304 Jul 16 19:28 VBoxEFI32.fd
-rw-r--r-- 1 root root  4194304 Jul 16 19:28 VBoxEFI64.fd
-rwxr-xr-x 1 root root    63792 Jul 16 19:28 VBoxExtPackHelperApp
-rwxr-xr-x 1 root root    34872 Jul 16 19:28 VBoxGuestControlSvc.so
-rwxr-xr-x 1 root root    43056 Jul 16 19:28 VBoxGuestPropSvc.so
-rwsr-xr-x 1 root root   166016 Jul 16 19:28 VBoxHeadless
-rwxr-xr-x 1 root root   133160 Jul 16 19:28 VBoxHeadless.so
-rwxr-xr-x 1 root root    18400 Jul 16 19:28 VBoxHostChannel.so
-rwxr-xr-x 1 root root    78080 Jul 16 19:28 VBoxKeyboard.so
-rwxr-xr-x 1 root root  3161368 Jul 16 19:28 VBoxManage
-rwsr-xr-x 1 root root    35040 Jul 16 19:28 VBoxNetAdpCtl
-rwsr-xr-x 1 root root   166016 Jul 16 19:28 VBoxNetDHCP
-rwxr-xr-x 1 root root   284744 Jul 16 19:28 VBoxNetDHCP.so
-rwsr-xr-x 1 root root   166016 Jul 16 19:28 VBoxNetNAT
-rwxr-xr-x 1 root root   350504 Jul 16 19:28 VBoxNetNAT.so
-rwxr-xr-x 1 root root   251800 Jul 16 19:28 VBoxPython3.so
-rwxr-xr-x 1 root root   251800 Jul 16 19:28 VBoxPython3m.so
-rwxr-xr-x 1 root root  3751904 Jul 16 19:28 VBoxRT.so
-rwsr-xr-x 1 root root   166008 Jul 16 19:28 VBoxSDL
-rwxr-xr-x 1 root root   202824 Jul 16 19:28 VBoxSDL.so
-rwxr-xr-x 1 root root 10098184 Jul 16 19:28 VBoxSVC
-rwxr-xr-x 1 root root   624936 Jul 16 19:28 VBoxSVGA3D.so
-rwxr-xr-x 1 root root    71632 Jul 16 19:28 VBoxSharedClipboard.so
-rwxr-xr-x 1 root root    75720 Jul 16 19:28 VBoxSharedFolders.so
-rwxr-xr-x 1 root root    72400 Jul 16 19:28 VBoxTestOGL
-rwxr-xr-x 1 root root  6297384 Jul 16 19:28 VBoxVMM.so
-rwxr-xr-x 1 root root    14352 Jul 16 19:28 VBoxVMMPreload.so
-rwxr-xr-x 1 root root  1471960 Jul 16 19:28 VBoxXPCOM.so
-rwxr-xr-x 1 root root    51232 Jul 16 19:28 VBoxXPCOMC.so
-rwxr-xr-x 1 root root    35032 Jul 16 19:28 VBoxXPCOMIPCD
-rw-r--r-- 1 root root  2739992 Jul 16 19:28 VMMR0.r0
-rwxr-xr-x 1 root root  3068872 Jul 16 19:28 VirtualBox
-rwsr-xr-x 1 root root   166016 Jul 16 19:28 VirtualBoxVM
-rwxr-xr-x 1 root root  1317264 Jul 16 19:28 VirtualBoxVM.so
drwxr-xr-x 2 root root     4096 Jul 16 23:23 components
-rwxr-xr-x 1 root root   145536 Jul 16 19:28 libvboxjxpcom.so
-rwxr-xr-x 1 root root   494408 Jul 16 19:28 vbox-img
-rwxr-xr-x 1 root root   146232 Jul 16 19:28 vboximg-mount
-rwxr-xr-x 1 root root 38936856 Jul 16 19:28 vboxwebsrv
-rwxr-xr-x 1 root root 30783904 Jul 16 19:28 webtest

mine

drwxr-xr-x 1 root root        1  6 ago 21.34 additions
drwxr-xr-x 1 root root        5  6 ago 21.34 components
-rwxr-xr-x 1 root root   436088 18 giu 21.30 DbgPlugInDiggers.so
drwxr-xr-x 1 root root        1  6 ago 21.34 ExtensionPacks
-rwxr-xr-x 1 root root   137232 18 giu 21.30 libvboxjxpcom.so
drwxr-xr-x 1 root root       81  6 ago 21.34 nls
-rwxr-xr-x 1 root root 28856320 18 giu 21.30 UICommon.so
-rwxr-xr-x 1 root root    38832 18 giu 21.30 VBoxAuthSimple.so
-rwxr-xr-x 1 root root    14216 18 giu 21.30 VBoxAuth.so
-rwxr-xr-x 1 root root   186840 18 giu 21.30 VBoxBalloonCtrl
-rwxr-xr-x 1 root root   155536 18 giu 21.30 VBoxDbg.so
-rwxr-xr-x 1 root root  8754800 18 giu 21.30 VBoxDD2.so
-rw-r--r-- 1 root root   310096 18 giu 21.30 VBoxDDR0.r0
-rwxr-xr-x 1 root root  3022368 18 giu 21.30 VBoxDD.so
-rwxr-xr-x 1 root root   470320 18 giu 21.30 VBoxDDU.so
-rwxr-xr-x 1 root root    38840 18 giu 21.30 VBoxDragAndDropSvc.so
-rwxr-xr-x 1 root root  2296936 18 giu 21.30 VBoxDxVk.so
-rw-r--r-- 1 root root  4194304 18 giu 21.30 VBoxEFI32.fd
-rw-r--r-- 1 root root  4194304 18 giu 21.30 VBoxEFI64.fd
-rwxr-xr-x 1 root root    63680 18 giu 21.30 VBoxExtPackHelperApp
-rwxr-xr-x 1 root root    30656 18 giu 21.30 VBoxGuestControlSvc.so
-rwxr-xr-x 1 root root    42944 18 giu 21.30 VBoxGuestPropSvc.so
-rwxr-xr-x 1 root root   120952 18 giu 21.30 VBoxHeadless
-rwxr-xr-x 1 root root    18288 18 giu 21.30 VBoxHostChannel.so
-rwxr-xr-x 1 root root   453344 18 giu 21.30 vbox-img
-rwxr-xr-x 1 root root   129744 18 giu 21.30 vboximg-mount
-rwxr-xr-x 1 root root    77968 18 giu 21.30 VBoxKeyboard.so
-rwxr-xr-x 1 root root  3030192 18 giu 21.30 VBoxManage
-rwxr-xr-x 1 root root    30840 18 giu 21.30 VBoxNetAdpCtl
-rwxr-xr-x 1 root root   268440 18 giu 21.30 VBoxNetDHCP
-rwxr-xr-x 1 root root   297336 18 giu 21.30 VBoxNetNAT
-rwxr-xr-x 1 root root  3428216 18 giu 21.30 VBoxRT.so
-rwxr-xr-x 1 root root   186528 18 giu 21.30 VBoxSDL
-rwxr-xr-x 1 root root    63320 18 giu 21.30 VBoxSharedClipboard.so
-rwxr-xr-x 1 root root    67416 18 giu 21.30 VBoxSharedFolders.so
-rwxr-xr-x 1 root root  9201760 18 giu 21.30 VBoxSVC
-rwxr-xr-x 1 root root   248000 18 giu 21.30 VBoxSVGA3D.so
-rwxr-xr-x 1 root root    72296 18 giu 21.30 VBoxTestOGL
-rwxr-xr-x 1 root root  6063808 18 giu 21.30 VBoxVMM.so
-rwxr-xr-x 1 root root 39182536 18 giu 21.30 vboxwebsrv
-rwxr-xr-x 1 root root    51128 18 giu 21.30 VBoxXPCOMC.so
-rwxr-xr-x 1 root root    34928 18 giu 21.30 VBoxXPCOMIPCD
-rwxr-xr-x 1 root root  1279344 18 giu 21.30 VBoxXPCOM.so
-rwxr-xr-x 1 root root  3056440 18 giu 21.30 VirtualBox
-rwxr-xr-x 1 root root  1329528 18 giu 21.30 VirtualBoxVM
-rw-r--r-- 1 root root  2744088 18 giu 21.30 VMMR0.r0
-rwxr-xr-x 1 root root 31267160 18 giu 21.30 webtest
ivan-hc commented 2 months ago

Overall, our VirtualBoxes are pretty similar.

If the extension pack doesn't matter, I'll remove it. We'll gain about 20 MB.

I'm wondering... are there any USB drivers or Arch Linux packages in particular that might make a difference?

Let me know.

ivan-hc commented 2 months ago

Also, I noticed this for the languages: I had to copy "nls" directory from /usr/share/virtualbox to /usr/lib/virtualbox to have languages working.

Well, /usr/share/virtualbox contain also these two scripts:

This is the content of VBoxCreateUSBNode.sh

#! /bin/sh
# $Id: VBoxCreateUSBNode.sh $ */
## @file
# VirtualBox USB Proxy Service, Linux Specialization.
# udev helper for creating and removing device nodes for VirtualBox USB devices
#

#
# Copyright (C) 2010-2023 Oracle and/or its affiliates.
#
# This file is part of VirtualBox base platform packages, as
# available from https://www.virtualbox.org.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, in version 3 of the
# License.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://www.gnu.org/licenses>.
#
# SPDX-License-Identifier: GPL-3.0-only
#

# Constant, from the USB specifications
usb_class_hub=09

do_remove=0
case "$1" in "--remove")
  do_remove=1; shift;;
esac
bus=`expr "$2" '/' 128 + 1`
device=`expr "$2" '%' 128 + 1`
class="$3"
group="$4"
devdir="`printf "/dev/vboxusb/%.3d" $bus`"
devpath="`printf "/dev/vboxusb/%.3d/%.3d" $bus $device`"
case "$do_remove" in
  0)
  if test -n "$class" -a "$class" = "$usb_class_hub"
  then
      exit 0
  fi
  case "$group" in "") group="vboxusers";; esac
  mkdir /dev/vboxusb -m 0750 2>/dev/null
  chown root:$group /dev/vboxusb 2>/dev/null
  mkdir "$devdir" -m 0750 2>/dev/null
  chown root:$group "$devdir" 2>/dev/null
  mknod "$devpath" c $1 $2 -m 0660 2>/dev/null
  chown root:$group "$devpath" 2>/dev/null
  ;;
  1)
  rm -f "$devpath"
  ;;
esac

and this is the content of VBoxSysInfo.sh

#!/bin/sh

# @file
#
# Installer (Unix-like)
# Information about the host system/Linux distribution

#
# Copyright (C) 2006-2023 Oracle and/or its affiliates.
#
# This file is part of VirtualBox base platform packages, as
# available from https://www.virtualbox.org.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, in version 3 of the
# License.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://www.gnu.org/licenses>.
#
# SPDX-License-Identifier: GPL-3.0-only
#

# Print information about a Linux system
# @param distribution name of the distribution
# @param version      version of the distribution
print_linux_info () {
    # The following regex is not quite correct for an e-mail address, as
    # the local part may not start or end with a dot.  Please correct if
    # this upsets you.
    kern_ver=`cat /proc/version | sed -e 's/ ([a-zA-Z0-9.!#$%*/?^{}\`+=_-]*@[a-zA-Z0-9.-]*)//'`
    echo "Distribution: $1 | Version: $2 | Kernel: $kern_ver"
}

# Determine the distribution name and release for a Linux system and print
# send the information to stdout using the print_linux_info function.
# For practical reasons (i.e. lack of time), this function only gives
# information for distribution releases considered "of interest" and reports
# others as unknown.  It can be extended later if other distributions are
# found to be "of interest".
get_linux_info () {
    if which lsb_release > /dev/null 2>&1
    then
        # LSB-compliant system
        print_linux_info `lsb_release -i -s` `lsb_release -r -s`
    elif [ -r /etc/debian_version ]
    then
        # Debian-based system
        release=`cat /etc/debian_version`
        print_linux_info "Debian" $release
    elif [ -r /etc/mandriva-release ]
    then
        # Mandriva-based system
        release=`cat /etc/mandriva-release | sed -e 's/[A-Za-z ]* release //'`
        print_linux_info "Mandriva" $release
    elif [ -r /etc/fedora-release ]
    then
        # Fedora-based
        release=`cat /etc/fedora-release | sed -e 's/[A-Za-z ]* release //'`
        print_linux_info "Fedora" $release
    elif [ -r /etc/SuSE-release ]
    then
        # SUSE-based.
        release=`cat /etc/SuSE-release | grep "VERSION" | sed -e 's/VERSION = //'`
        if grep openSUSE /etc/SuSE-release
        then
            # Is it worth distinguishing here?  I did it mainly to prevent
            # confusion with the version number
            print_linux_info "openSUSE" $release
        else
            print_linux_info "SUSE" $release
        fi
    elif [ -r /etc/gentoo-release ]
    then
        # Gentoo-based
        release=`cat /etc/gentoo-release | sed -e 's/[A-Za-z ]* release //'`
        print_linux_info "Gentoo" $release
    elif [ -r /etc/slackware-version ]
    then
        # Slackware
        release=`cat /etc/slackware-version | sed -e 's/Slackware //'`
        print_linux_info "Slackware" $release
    elif [ -r /etc/arch-release ]
    then
        # Arch Linux
        print_linux_info "Arch Linux" "none"
    elif [ -r /etc/redhat-release ]
    then
        # Redhat-based.  This should come near the end, as it other
        # distributions may give false positives.
        release=`cat /etc/redhat-release | sed -e 's/[A-Za-z ]* release //'`
        print_linux_info "Redhat" $release
    else
        print_linux_info "unknown" "unknown"
    fi
}

# Print information about a Solaris system.  FIXME.
get_solaris_info () {
    kernel=`uname -v`
    echo "Kernel: $kernel"
}

# Print information about a MacOS system.  FIXME.
get_macos_info () {
    machine=`uname -m`
    kernel=`uname -v`
    echo "Machine: $machine | Kernel: $kernel"
}

# Print information about a FreeBSD system.  FIXME.
get_freebsd_info () {
    kernel=`uname -v`
    echo "Kernel: $kernel"
}

system=`uname -s`
case "$system" in
Linux|linux)
    get_linux_info
    ;;
SunOS)
    get_solaris_info
    ;;
Darwin)
    get_macos_info
    ;;
FreeBSD)
    get_freebsd_info
    ;;
*)
    echo "System unknown"
    exit 1
    ;;
esac
exit 0

the question is, would to copy these scripts in /usr/lib/virtualbox made a difference?

ivan-hc commented 2 months ago

I have just tested by running conty with these options

 --bind /etc/group /etc/group --bind /etc/udev/rules.d /etc/udev/rules.d 

and didn't worked

in brief, I have exposed the /etc/group file from the host to let VirtualBox see that I am in the damn "vboxusers" group and then I have xposed the content of /etc/udev/rules.d containing the damn "60-vboxusb.rules" file containing this

SUBSYSTEM=="usb_device", ACTION=="add", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
SUBSYSTEM=="usb_device", ACTION=="remove", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"

I still don't understand what the hell I should do.

ivan-hc commented 2 months ago

Note that I've also created a release on my fork of Conty that adds these packages:

I give up.

Kron4ek commented 2 months ago

I removed VirtualBox from the host system completely, then i did what's written on https://github.com/cyberus-technology/virtualbox-kvm#usb-pass-through and rebooted. After that USB devices are visible in your VirtualBox-appimage.

I took VBoxCreateUSBNode.sh script from the virtualbox package from the Arch Linux repo.

ivan-hc commented 2 months ago

I removed VirtualBox from the host system completely, then i did what's written on https://github.com/cyberus-technology/virtualbox-kvm#usb-pass-through and rebooted. After that USB devices are visible in your VirtualBox-appimage.

I took VBoxCreateUSBNode.sh script from the virtualbox package from the Arch Linux repo.

so we still need to create the directory /usr/lib/virtualbox on our system then, with that file

ivan-hc commented 2 months ago

I removed VirtualBox from the host system completely, then i did what's written on https://github.com/cyberus-technology/virtualbox-kvm#usb-pass-through and rebooted. After that USB devices are visible in your VirtualBox-appimage.

I took VBoxCreateUSBNode.sh script from the virtualbox package from the Arch Linux repo.

WORKS!

Istantanea_2024-08-09_19-57-06

ivan-hc commented 2 months ago

I'll try to add this directly in the AppRun, using an option --enable-usb or something

ivan-hc commented 2 months ago

I think its better to add this function to the AppRun of the AppImage

VBoxUSB_enable() {
    if ! test -f /usr/lib/virtualbox/VBoxCreateUSBNode.sh; then
        sudo mkdir -p /usr/lib/virtualbox
        "${HERE}"/conty.sh cp /usr/share/virtualbox/VBoxCreateUSBNode.sh ./
        chmod a+x VBoxCreateUSBNode.sh
        sudo mv VBoxCreateUSBNode.sh /usr/lib/virtualbox/
        sudo chown -R root:vboxusers /usr/lib/virtualbox
    fi
}

at least to place this file in the correct place.

Or should I add the complete process?

ivan-hc commented 2 months ago

Maybe I must also add the command to create "vboxusers" at first

ivan-hc commented 2 months ago
VBoxUSB_enable() {
    if ! test -f /usr/lib/virtualbox/VBoxCreateUSBNode.sh; then
        # Create the "vboxusers" group and add $USER
        sudo groupadd -r vboxusers -U "$USER"
        # Create the directore /usr/lib/virtualbox on the host system
        sudo mkdir -p /usr/lib/virtualbox
        # Install the "VBoxCreateUSBNode.sh" script in /usr/lib/virtualbox
        "${HERE}"/conty.sh cp /usr/share/virtualbox/VBoxCreateUSBNode.sh ./
        chmod a+x VBoxCreateUSBNode.sh
        sudo mv VBoxCreateUSBNode.sh /usr/lib/virtualbox/
        sudo chown -R root:vboxusers /usr/lib/virtualbox
    fi
}
ivan-hc commented 2 months ago

This is the complete workflow

VBoxUSB_enable() {
    if ! test -f /usr/lib/virtualbox/VBoxCreateUSBNode.sh; then
        # Create the "vboxusers" group and add $USER
        sudo groupadd -r vboxusers -U "$USER"
        # Create the directore /usr/lib/virtualbox on the host system
        sudo mkdir -p /usr/lib/virtualbox
        # Install the "VBoxCreateUSBNode.sh" script in /usr/lib/virtualbox
        "${HERE}"/conty.sh cp /usr/share/virtualbox/VBoxCreateUSBNode.sh ./
        chmod a+x VBoxCreateUSBNode.sh
        sudo mv VBoxCreateUSBNode.sh /usr/lib/virtualbox/
        sudo chown -R root:vboxusers /usr/lib/virtualbox
    fi
    if ! test -f /etc/udev/rules.d/60-vboxusb.rules; then
        # Create the directory /etc/udev/rules.d
        sudo mkdir -p /etc/udev/rules.d
        # Create and install the 60-vboxusb.rules file in /etc/udev/rules.d
        cat <<-'HEREDOC' >> ./60-vboxusb.rules
        SUBSYSTEM=="usb_device", ACTION=="add", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
        SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
        SUBSYSTEM=="usb_device", ACTION=="remove", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
        SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
        HEREDOC
        sudo mv 60-vboxusb.rules /etc/udev/rules.d/
        # Reload the udev rules
        sudo systemctl reload systemd-udevd
    fi
}

Now I should add messages.

ivan-hc commented 2 months ago

the changes will be available in the next release https://github.com/ivan-hc/VirtualBox-appimage/commit/6332c243e3b745d2384241b12e49ddd637b1b701

it will be enough to run the AppImage with the option --vbox-usb-enable, add the "sudo" password and reboot.

Those interested in testing a preview, can run this script wherever they wants

https://github.com/ivan-hc/VirtualBox-appimage/blob/main/virtualbox-conty-builder.sh

this will download the conty.sh file from my fork of Conty https://github.com/ivan-hc/Conty/releases/tag/continuous-virtualbox and then it will convert everything into an AppImage.

Run the created AppImage like this

./*AppImage --vbox-usb-enable

this will be the prompt

Istantanea_2024-08-09_21-29-31

@qq895311511 let me know if it works for you too.

ivan-hc commented 2 months ago

For those that want test the AppRun instead, its enough to extract the AppImage and replace the content of the AppRun with this

#!/bin/sh
HERE="$(dirname "$(readlink -f "${0}")")"
export UNION_PRELOAD="${HERE}"

Show_help_message() {
    printf " Available options:\n"
    printf "\n  --vbox-usb-enable\n"
    printf "\n  Enable USB support in Virtual Machines. Requires \"sudo\" password.\n"
    printf "\n  The above option does the following:\n"
    printf "\n  - Creates the \"vboxusers\" group"
    printf "\n  - Adds your \$USER to the \"vboxusers\" group"
    printf "\n  - Creates the /usr/lib/virtualbox directory on the host system"
    printf "\n  - Installs the \"VBoxCreateUSBNode.sh\" script in /usr/lib/virtualbox"
    printf "\n  - Creates the /etc/udev/rules.d directory"
    printf "\n  - Creates and installs the \"60-vboxusb.rules\" file in /etc/udev/rules.d\n"
    printf "\n  VirtualBoxVM\n"
    printf "\n  A VirtualBox command to handle Virtual Machines via command line\n\n"
}

VBoxUSB_enable() {
    printf "\n The above option does the following:\n"
    printf "\n - Creates the \"vboxusers\" group"
    printf "\n - Adds your \$USER to the \"vboxusers\" group"
    printf "\n - Creates the /usr/lib/virtualbox directory on the host system"
    printf "\n - Installs the \"VBoxCreateUSBNode.sh\" script in /usr/lib/virtualbox"
    printf "\n - Creates the /etc/udev/rules.d directory"
    printf "\n - Creates and installs the \"60-vboxusb.rules\" file in /etc/udev/rules.d\n"
    printf "\n See also https://github.com/cyberus-technology/virtualbox-kvm#usb-pass-through\n"
    printf "\nAuthentication is required\n"
    if ! test -f /usr/lib/virtualbox/VBoxCreateUSBNode.sh; then
        # Create the "vboxusers" group and add $USER
        sudo groupadd -r vboxusers -U "$USER" 
        # Create the directory /usr/lib/virtualbox on the host system
        sudo mkdir -p /usr/lib/virtualbox
        # Install the "VBoxCreateUSBNode.sh" script in /usr/lib/virtualbox
        QUIET_MODE=1 NVIDIA_HANDLER=0 "${HERE}"/conty.sh cp /usr/share/virtualbox/VBoxCreateUSBNode.sh ./
        chmod a+x VBoxCreateUSBNode.sh
        sudo mv VBoxCreateUSBNode.sh /usr/lib/virtualbox/
        sudo chown -R root:vboxusers /usr/lib/virtualbox
    fi
    if ! test -f /etc/udev/rules.d/60-vboxusb.rules; then
        # Create the directory /etc/udev/rules.d
        sudo mkdir -p /etc/udev/rules.d
        # Create and install the 60-vboxusb.rules file in /etc/udev/rules.d
        cat <<-'HEREDOC' >> ./60-vboxusb.rules
        SUBSYSTEM=="usb_device", ACTION=="add", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
        SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
        SUBSYSTEM=="usb_device", ACTION=="remove", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
        SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
        HEREDOC
        sudo mv 60-vboxusb.rules /etc/udev/rules.d/
        # Reload the udev rules
        sudo systemctl reload systemd-udevd
    fi
    printf "\nIt is recommended that you reboot for the changes to take effect.\n"
}

case "$1" in
    '')
        "${HERE}"/conty.sh virtualbox
        ;;
    'VirtualBoxVM')
        "${HERE}"/conty.sh "$1" "$@"
        ;;
    '-h'|'--help')
        Show_help_message
        ;;
    '--vbox-usb-enable')
        VBoxUSB_enable
        ;;
    '-v'|'--version')
        echo "VirtualBox VERSION KVM"
        ;;
    'virtualbox'|*) "${HERE}"/conty.sh VirtualBox "$@"
    ;;
esac | grep -v "You\|vboxdrv\|available for the current kernel\|Please recompile the kernel module\|sudo /sbin/vboxconfig"
ivan-hc commented 2 months ago

The workflow is running right now, I've just finished all my tests and everything works.

You can see the rules at https://github.com/ivan-hc/VirtualBox-appimage?tab=readme-ov-file#usb-support

This issue will be also available on the README, as a reference.

The new release will be available in minutes... finally!

Thanks for your attention and interest!