Edit Info Other
Login

VirtualBox"

Differences between revisions 6 and 36 (spanning 30 versions)
Revision 6 as of 2016-03-07 21:14:47
Size: 2003
Comment:
Revision 36 as of 2020-11-23 22:23:56
Size: 6396
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
Line 8: Line 9:
Since F22+ we don't have pre-built kmods we need use akmods.
Line 10: Line 13:
    dnf install VirtualBox kernel-devel-$(uname -r)  akmod-VirtualBox     dnf install VirtualBox kernel-devel-$(uname -r) akmod-VirtualBox
Line 13: Line 16:
    dmesg | grep -i vbox     lsmod  | grep -i vbox
Line 16: Line 20:
{{{
vboxnetadp 28672 0
vboxnetflt 32768 0
vboxdrv 557056 2 vboxnetadp,vboxnetflt
Line 17: Line 25:
{{{
    [ 2870.556703] vboxdrv: module verification failed: signature and/or required key missing - tainting kernel
    [ 2870.565213] vboxdrv: Found 2 processor cores
    [ 2870.571315] vboxdrv: fAsync=0 offMin=0x1c2 offMax=0xa5f
    [ 2870.671515] vboxdrv: TSC mode is Synchronous, tentative frequency 3000795689 Hz
    [ 2870.671519] vboxdrv: Successfully loaded version 5.0.6_ (interface 0x00240000)
    [ 2870.671946] VBoxNetFlt: Successfully started.
    [ 2870.672227] VBoxNetAdp: Successfully started.

 
Line 26: Line 28:
   == First time installation ==
Line 27: Line 31:
== sign kernel modules == The installation of !VirtualBox-server package, will created the "vboxusers" group.
Line 29: Line 33:
To sign kernel modules to make work with secure boot, this 2 posts are a good reference , I haven't test my self: For each user that you want run !VirtualBox, please do as root:

usermod -a -G vboxusers username ( usermod -a -G vboxusers sergiomb )

or use the GUI Users and Groups tool.

== Sign kernel modules to work with secure boot ==

To sign kernel modules to make work with secure boot, this 2 posts are a good reference, I haven't test my self:
Line 33: Line 45:
https://ask.fedoraproject.org/en/question/34470/virtual-box-on-fedora-19-fails-to-start-a-vm/ https://askbot.fedoraproject.org/en/question/34470/virtual-box-on-fedora-19-fails-to-start-a-vm/
Line 35: Line 47:
or google for "virtualbox fedora secure boot" , or google for "virtualbox fedora secure boot", we have some progresses here [3]

[3] https://bugzilla.redhat.com/show_bug.cgi?id=1454824
  
Line 39: Line 54:
1- if you don't need usb or just for testing , go to setting usb and disable 1- If you don't need usb or just for testing , go to setting usb and disable
Line 42: Line 57:
2 - with firefox click here : 2 - With firefox download Oracle_VM_VirtualBox_Extension_Pack-5.1.30.vbox-extpack for example click here :
Line 46: Line 61:
3 - after try file -> check for updates , also should install the correct 3 - After try file -> check for updates , also should install the correct
Line 51: Line 66:
rm -rf /usr/lib64/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack rm -rf /usr/lib64/virtualbox/ExtensionPacks/Oracle_VM_!VirtualBox_Extension_Pack
Line 55: Line 70:
    == Upgrade VirtualBox version without reboot ==

On upgrade !VirtualBox for a new release, we need remove kernel modules loaded and load new ones (for the new release).

{{{
    dnf update VirtualBox kernel-devel-$(uname -r) akmod-VirtualBox
    akmods-shutdown

    # User is advised to run this after upgrades
    /sbin/modprobe -r -b vboxnetflt
    /sbin/modprobe -r -b vboxnetadp
    /sbin/modprobe -r -b vboxdrv
    /sbin/modprobe -r -b vboxpci
    /sbin/modprobe -r -b vboxdrv

    systemctl restart systemd-modules-load
    dmesg | grep -i vbox
}}}

if you run an upgrade version don't forget update also !VirtualBox_Extension_Pack (if you have it installed)
http://rpmfusion.org/Howto/VirtualBox#Install_VirtualBox_Extension_Pack


== Fedora as a Virtual Machine and VBoxGuestAdditions ==

If you want run Fedora in a vm, you may/should install !VirtualBox-guest-additions.
    
!VirtualBox-guest-additions replaces VBoxGuestAdditions for Fedora, !VirtualBox-guest-additions is just to install in a vm (guest system), You can't install !VirtualBox-guest-additions in a host system. Therefore !VirtualBox-guest-additions conflicts with !VirtualBox by design.

RPM Fusion doesn't provide VBoxGuestAdditions for others OS , you have to download it , you have a button for that in !VirtualBox, vm manager menu.
{{{

    dnf install VirtualBox-guest-additions kernel-devel-$(uname -r)
    akmods
    systemctl restart systemd-modules-load
    systemctl restart vboxservice
    dmesg
}}}
In the last lines should see something like :
{{{
[ 1907.370440] VBoxService 5.0.17_ r105877 (verbosity: 0) linux.amd64 (Apr 1 2016 05:26:22) release log
               00:00:00.000103 main Log opened 2016-04-02T01:32:31.428335000Z
[ 1907.370508] 00:00:00.000250 main OS Product: Linux
[ 1907.370550] 00:00:00.000291 main OS Release: 4.5.0-0.rc7.git0.2.fc24.x86_64
[ 1907.370849] 00:00:00.000575 main OS Version: #1 SMP Tue Mar 8 02:20:08 UTC 2016
[ 1907.371947] 00:00:00.000708 main Executable: /usr/bin/VBoxService
               00:00:00.000711 main Process ID: 3002
               00:00:00.001639 main Package type: LINUX_64BITS_GENERIC (OSE)
[ 1907.374751] 00:00:00.004436 main 5.0.17_ r105877 started. Verbose level = 0
}}}
  

== I had install kernel-debug-devel but I need kernel-devel ==

When we install only !VirtualBox {{{ dnf install VirtualBox }}} it require one kmod so it pulls akmod-!VirtualBox (we, at this moment, don't have binary kmods) and also may pulls in kernel-debug-devel instead of kernel-devel (of the running kernel) [1]. We need the kernel-devel of kernel that is running on the system but we can't workaround this problem. So we need make sure that install proper kernel-devel (usually the kernel-devel).

So
{{{
   dnf install kernel-devel-$(uname -r)
   dnf remove kernel-debug-devel
}}}


[1] https://bugzilla.redhat.com/show_bug.cgi?id=1228897


== VirtualBox kernel modules fail to load with systemd-modules-load.service ==

Unfortunately SELinux prevents to load vbox modules [2], so we need disable selinux.

[2] https://bugzilla.rpmfusion.org/show_bug.cgi?id=4147

== Selinux and VirtualBox ==

ATM, we don't support running !VirtualBox with selinux enabled, solution is disable selinux.

== Uninstall "official" virtual-guest-additions and use virtualbox-guest-additions package provide by Fedora ==

navigate to /run/media/<my user name>/VBoxGAs_6.0.4
issue command './VBoxLinuxAdditions.run uninstall'

issue command 'sudo dnf remove virtualbox-linux-additions akmod-VirtualBox'

issue command 'sudo dnf install VirtualBox-linux-additions akmod-VirtualBox'

issue command 'sudo akmods-shutdown'

This command built kmods for 5.0.3, 5.0.4, 5.0.5, taking a couple of minutes.

shut down the Fedora 29 Virtual Machine. (Use GUI or issue command 'sudo shutdown -h now') (I could use the -r flag, but I generally prefer when shutting down to have the machine completely shut down for 15-30 seconds before restarting.)

start the Fedora 29 Virtual Machine.

At this point, the shared folders were visible!



----
CategoryHowto

About this Howto

The goal is have a place with all information that is FAQ.

Quick install

Since F22+ we don't have pre-built kmods we need use akmods.

Please do:

    dnf install VirtualBox kernel-devel-$(uname -r) akmod-VirtualBox
    akmods
    systemctl restart systemd-modules-load.service
    lsmod  | grep -i vbox

result:

vboxnetadp             28672  0
vboxnetflt             32768  0
vboxdrv               557056  2 vboxnetadp,vboxnetflt

First time installation

The installation of VirtualBox-server package, will created the "vboxusers" group.

For each user that you want run VirtualBox, please do as root:

usermod -a -G vboxusers username ( usermod -a -G vboxusers sergiomb )

or use the GUI Users and Groups tool.

Sign kernel modules to work with secure boot

To sign kernel modules to make work with secure boot, this 2 posts are a good reference, I haven't test my self:

http://stackoverflow.com/questions/29480176/how-to-install-virtualbox-on-linux-secure-boot-systems-bash-script

https://askbot.fedoraproject.org/en/question/34470/virtual-box-on-fedora-19-fails-to-start-a-vm/

or google for "virtualbox fedora secure boot", we have some progresses here [3]

[3] https://bugzilla.redhat.com/show_bug.cgi?id=1454824

Install VirtualBox_Extension_Pack

1- If you don't need usb or just for testing , go to setting usb and disable usb , for that you have to have vm machine off .

2 - With firefox download Oracle_VM_VirtualBox_Extension_Pack-5.1.30.vbox-extpack for example click here : http://download.virtualbox.org/virtualbox/5.0.14/Oracle_VM_VirtualBox_Extension_Pack-5.0.14.vbox-extpack firefox should ask if you want install with vbox something , say yes

3 - After try file -> check for updates , also should install the correct extpackage

if this doesn't do nothing because you install a superior version

rm -rf /usr/lib64/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack as root , and repeat items 2 and 3

anyway , you should use file -> check for updates to update extension pack

Upgrade VirtualBox version without reboot

On upgrade VirtualBox for a new release, we need remove kernel modules loaded and load new ones (for the new release).

    dnf update VirtualBox kernel-devel-$(uname -r) akmod-VirtualBox
    akmods-shutdown

    # User is advised to run this after upgrades
    /sbin/modprobe -r -b vboxnetflt
    /sbin/modprobe -r -b vboxnetadp
    /sbin/modprobe -r -b vboxdrv
    /sbin/modprobe -r -b vboxpci
    /sbin/modprobe -r -b vboxdrv

    systemctl restart systemd-modules-load
    dmesg | grep -i vbox

if you run an upgrade version don't forget update also VirtualBox_Extension_Pack (if you have it installed) http://rpmfusion.org/Howto/VirtualBox#Install_VirtualBox_Extension_Pack

Fedora as a Virtual Machine and VBoxGuestAdditions

If you want run Fedora in a vm, you may/should install VirtualBox-guest-additions.

VirtualBox-guest-additions replaces VBoxGuestAdditions for Fedora, VirtualBox-guest-additions is just to install in a vm (guest system), You can't install VirtualBox-guest-additions in a host system. Therefore VirtualBox-guest-additions conflicts with VirtualBox by design.

RPM Fusion doesn't provide VBoxGuestAdditions for others OS , you have to download it , you have a button for that in VirtualBox, vm manager menu.

    dnf install VirtualBox-guest-additions kernel-devel-$(uname -r) 
    akmods 
    systemctl restart systemd-modules-load
    systemctl restart vboxservice
    dmesg 

In the last lines should see something like :

[ 1907.370440] VBoxService 5.0.17_ r105877 (verbosity: 0) linux.amd64 (Apr  1 2016 05:26:22) release log
               00:00:00.000103 main     Log opened 2016-04-02T01:32:31.428335000Z
[ 1907.370508] 00:00:00.000250 main     OS Product: Linux
[ 1907.370550] 00:00:00.000291 main     OS Release: 4.5.0-0.rc7.git0.2.fc24.x86_64
[ 1907.370849] 00:00:00.000575 main     OS Version: #1 SMP Tue Mar 8 02:20:08 UTC 2016
[ 1907.371947] 00:00:00.000708 main     Executable: /usr/bin/VBoxService
               00:00:00.000711 main     Process ID: 3002
               00:00:00.001639 main     Package type: LINUX_64BITS_GENERIC (OSE)
[ 1907.374751] 00:00:00.004436 main     5.0.17_ r105877 started. Verbose level = 0

I had install kernel-debug-devel but I need kernel-devel

When we install only VirtualBox  dnf install VirtualBox  it require one kmod so it pulls akmod-VirtualBox (we, at this moment, don't have binary kmods) and also may pulls in kernel-debug-devel instead of kernel-devel (of the running kernel) [1]. We need the kernel-devel of kernel that is running on the system but we can't workaround this problem. So we need make sure that install proper kernel-devel (usually the kernel-devel).

So

   dnf install kernel-devel-$(uname -r)
   dnf remove kernel-debug-devel

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1228897

VirtualBox kernel modules fail to load with systemd-modules-load.service

Unfortunately SELinux prevents to load vbox modules [2], so we need disable selinux.

[2] https://bugzilla.rpmfusion.org/show_bug.cgi?id=4147

Selinux and VirtualBox

ATM, we don't support running VirtualBox with selinux enabled, solution is disable selinux.

Uninstall "official" virtual-guest-additions and use virtualbox-guest-additions package provide by Fedora

navigate to /run/media/<my user name>/VBoxGAs_6.0.4 issue command './VBoxLinuxAdditions.run uninstall'

issue command 'sudo dnf remove virtualbox-linux-additions akmod-VirtualBox'

issue command 'sudo dnf install VirtualBox-linux-additions akmod-VirtualBox'

issue command 'sudo akmods-shutdown'

This command built kmods for 5.0.3, 5.0.4, 5.0.5, taking a couple of minutes.

shut down the Fedora 29 Virtual Machine. (Use GUI or issue command 'sudo shutdown -h now') (I could use the -r flag, but I generally prefer when shutting down to have the machine completely shut down for 15-30 seconds before restarting.)

start the Fedora 29 Virtual Machine.

At this point, the shared folders were visible!


CategoryHowto

Howto/VirtualBox (last edited 2024-04-21 02:49:49 by Sérgio Basto)