Is Selinux Preventing Virtualbox from working properly?
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2018
    Location
    United States
    Posts
    9
    Linux (Fedora) Firefox 61.0

    Question Is Selinux Preventing Virtualbox from working properly?

    Hi,

    I'm having issues with getting my Ubuntu vm to run. I keep getting this error even after installing the dkms package from the Fedora repositories. I installed Virtualbox from their rpm package hosted on their site. When I saw "or there is a permission problem with /dev/vboxdrv" I thought that it might be selinux preventing it from running. I pretty much never mess around with selinux as I like the fact that it adds another layer of security for my installation but heard it can also be a pain. I'd rather not disable it. Maybe set it to permissive? Does anyone know what I can do here to get my VM to work?

    Click image for larger version. 

Name:	Screenshot from 2018-08-11 13-30-37.jpg 
Views:	18 
Size:	72.1 KB 
ID:	29762
    Last edited by vampirefox2; 11th August 2018 at 09:42 PM.

  2. #2
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,332
    Linux (Fedora) Firefox 61.0

    Re: Is Selinux Preventing Virtualbox from working properly?

    Quote Originally Posted by vampirefox2
    Hi,

    I'm having issues with getting my Ubuntu vm to run. I keep getting this error even after installing the dkms package from the Fedora repositories. I installed Virtualbox from their rpm package hosted on their site. When I saw "or there is a permission problem with /dev/vboxdrv" I thought that it might be selinux preventing it from running. I pretty much never mess around with selinux as I like the fact that it adds another layer of security for my installation but heard it can also be a pain. I'd rather not disable it. Maybe set it to permissive? Does anyone know what I can do here to get my VM to work?

    Click image for larger version. 

Name:	Screenshot from 2018-08-11 13-30-37.jpg 
Views:	18 
Size:	72.1 KB 
ID:	29762
    It's easy to test whether it's a problem, just run "sudo setenforce 0" on the host then try VirtualBox again with the VM, if the VM suddenly works, that probably means it was a SELinux problem.

    Afterwards run "sudo setenforce 1" to go back to Enforced mode (0 means "Permissive"), in any case "setenforce" is a real time only command. The next reboot will go back to the normal settings for your host

  3. #3
    Join Date
    Aug 2018
    Location
    United States
    Posts
    9
    Linux (Fedora) Firefox 61.0

    Re: Is Selinux Preventing Virtualbox from working properly?

    Welp it's not selinux becuase I'm getting the same error. I've tried installing packages to get it to work but no luck.

    su -c 'yum install kernel-devel dkms kernel-headers'

    su -c 'yum install dkms'

  4. #4
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,332
    Linux (Fedora) Firefox 61.0

    Re: Is Selinux Preventing Virtualbox from working properly?

    What version of VBox do you have?

    I noticed some problems with VirtualBox-5.2-5.2.10_122088_fedora26-1.x86_64 when I ran vboxconfig against the newest kernel 4.17.12-200.fc28.x86_64 (I saw errors and a suggestion to view vbox-install.log)


    less /var/log/vbox-install.log
    Code:
    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)
    I then ran "dnf check-update --refresh" and saw there was a VirtualBox update, updated to that and re-ran vboxconfig and all was okay:

    Code:
    dnf update 
    Last metadata expiration check: 0:00:08 ago on Sat 11 Aug 2018 05:16:19 PM EDT.
    Dependencies resolved.
    =============================================================================================================================
     Package                       Arch                  Version                                 Repository                 Size
    =============================================================================================================================
    Upgrading:
     VirtualBox-5.2                x86_64                5.2.16_123759_fedora26-1                virtualbox                 69 M
    
    Transaction Summary
    =============================================================================================================================
    Upgrade  1 Package
    
    Total download size: 69 M
    Is this ok [y/N]: y
    Downloading Packages:
    VirtualBox-5.2-5.2.16_123759_fedora26-1.x86_64.rpm                                           6.5 MB/s |  69 MB     00:10    
    -----------------------------------------------------------------------------------------------------------------------------
    Total                                                                                        6.5 MB/s |  69 MB     00:10     
    Running transaction check
    Transaction check succeeded.
    Running transaction test
    Transaction test succeeded.
    Running transaction
      Preparing        :                                                                                                     1/1 
      Running scriptlet: VirtualBox-5.2-5.2.16_123759_fedora26-1.x86_64                                                      1/2 
      Upgrading        : VirtualBox-5.2-5.2.16_123759_fedora26-1.x86_64                                                      1/2
      Running scriptlet: VirtualBox-5.2-5.2.16_123759_fedora26-1.x86_64                                                      1/2
    
    Creating group 'vboxusers'. VM users must be member of that group!
    
      Running scriptlet: VirtualBox-5.2-5.2.10_122088_fedora26-1.x86_64                                                      2/2
      Cleanup          : VirtualBox-5.2-5.2.10_122088_fedora26-1.x86_64                                                      2/2
      Running scriptlet: VirtualBox-5.2-5.2.10_122088_fedora26-1.x86_64                                                      2/2
      Verifying        : VirtualBox-5.2-5.2.16_123759_fedora26-1.x86_64                                                      1/2
      Verifying        : VirtualBox-5.2-5.2.10_122088_fedora26-1.x86_64                                                      2/2
    
    Upgraded:
      VirtualBox-5.2.x86_64 5.2.16_123759_fedora26-1
    
    Complete!
    I was then seeing a valid set of modules:
    Code:
    lsmod | grep vbox
    vboxpci                28672  0
    vboxnetadp             28672  0
    vboxnetflt             32768  0
    vboxdrv               491520  3 vboxpci,vboxnetadp,vboxnetflt
    So the short story is, try to update to the latest VirtualBox-5.2.x86_64 5.2.16_123759_fedora26-1
    Last edited by marko; 11th August 2018 at 10:34 PM.

  5. #5
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,332
    Linux (Fedora) Firefox 61.0

    Re: Is Selinux Preventing Virtualbox from working properly?

    Another thing, kvm + virt-manager is really pretty good now, and it's completely open and comes from the normal redhat/ Fedora repos. And you don't have to mess with building modules and fixing them, kvm module is already in the kernel. Another plus is not having to deal with Oracle's code and it's frequent flakiness with the kernel

  6. #6
    Join Date
    Aug 2018
    Location
    United States
    Posts
    9
    Linux (Fedora) Firefox 61.0

    Re: Is Selinux Preventing Virtualbox from working properly?

    I downloaded and installed version 5.2.16 (Latest) from the .rpm package manually. Used dnfdragora to install it. Did you install it from their repository rather than doing it manually? I haven't tried that yet.

  7. #7
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,332
    Linux (Fedora) Firefox 61.0

    Re: Is Selinux Preventing Virtualbox from working properly?

    I always just use the Oracle repo

    Added this file as /etc/yum.repos.d/virtualbox.repo
    [virtualbox]
    name=Fedora $releasever - $basearch - VirtualBox
    baseurl=http://download.virtualbox.org/virtualbox/rpm/fedora/$releasever/$basearch
    enabled=1
    gpgcheck=1
    repo_gpgcheck=1
    gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc
    then installed VirtualBox-5.2 from that repo so that I had VirtualBox-5.2-5.2.16_123759_fedora26-1.x86_64

  8. #8
    Join Date
    Aug 2018
    Location
    United States
    Posts
    9
    Linux (Fedora) Firefox 61.0

    Re: Is Selinux Preventing Virtualbox from working properly?

    I gave up on it and switched to Gnome Boxes. It's crazy how complicated that is as I wasted hours trying to just install "Virtualbox" itself and get it to work. Hopefully I haven't messed up my system with all the crap I installed hoping to get it to work. Is there a way I can verify that things aren't messed up? I'm pretty sure I uninstalled most the packages that I installed earlier.

  9. #9
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,332
    Linux (Fedora) Firefox 61.0

    Re: Is Selinux Preventing Virtualbox from working properly?

    I've found the VirtualBox from the Oracle repo to be pretty easy, they have a page at https://www.virtualbox.org/

    I suspect the VirtualBox you had trouble with is the rpmfusion one

    if you removed "VirtualBox-5.2" that should be okay.

    "gnome-boxes" is a front end to kvm/qemu, so it's similar to the virt-manager I was talking about before.

  10. #10
    Join Date
    Mar 2004
    Location
    In your closet
    Posts
    15,714
    Linux (Fedora) Firefox 61.0

    Re: Is Selinux Preventing Virtualbox from working properly?

    Regarding VirtualBox. Reboot into the newest installed kernel and try VirtualBox again.
    Glenn
    The Bassinator

Similar Threads

  1. [Fedora 20] SELinux preventing OpenVpn from working
    By kawaiisenpai in forum Using Fedora
    Replies: 2
    Last Post: 3rd January 2014, 02:24 AM
  2. SELinux is preventing
    By Blisk in forum Using Fedora
    Replies: 19
    Last Post: 7th June 2011, 06:25 AM
  3. SElinux is preventing...
    By Beralus in forum Security and Privacy
    Replies: 4
    Last Post: 18th November 2008, 09:24 AM
  4. SELinux is preventing...
    By T3256 in forum Security and Privacy
    Replies: 16
    Last Post: 19th October 2008, 04:50 AM
  5. SELinux preventing syslog?
    By pobbz in forum Security and Privacy
    Replies: 2
    Last Post: 23rd July 2006, 09:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •