Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem installing virtualbox #939

Closed
nullterminated opened this issue Jul 20, 2014 · 32 comments
Closed

Problem installing virtualbox #939

nullterminated opened this issue Jul 20, 2014 · 32 comments
Labels

Comments

@nullterminated
Copy link

My system is Acer C720, running xfce 14.04 with crouton.

uname -r

3.4.0

I followed the instructions to build linux headers for the 3.4 branch found on the wiki here

https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-%28x86%29

The process failed when I reached

$ make-kpkg --rootcmd fakeroot kernel_image kernel_headers

The error was

gcc: error: unrecognized command line option ‘-fstack-protector-strong’

Google tells me fstack-protector-strong is new in GCC 4.9. apt-get told me I already had gcc-4.9, but close inspection reveals that

/usr/lib/gcc//4.9/ are all empty

I seems not much is installed for 4.9 here:

http://packages.ubuntu.com/trusty/amd64/gcc-4.9-base/filelist

I built GCC 4.9 with the process I described in issue 797

#797

Then I was able to successfully build the 3.4 branch. Once I installed the build products, I tried to install virtualbox.

sudo apt-get install virtualbox

The install runs but I see:

No suitable module for running kernel found

The install then builds the modules successfully, but then I see another error:

modprobe vboxdrv failed. Please use 'dmesg' to find out why

dmesg | tail

[14148.574653] Chromium OS LSM: init_module denied module="/lib/modules/3.4.0/updates/dkms/vboxdrv.ko" pid=32764 cmdline="modprobe vboxdrv"

sudo /sbin/modprobe -v vboxdrv

modprobe: ERROR: could not insert 'vboxdrv': Operation not permitted

I see no /etc/init.d/vboxdrv. I only see /etc/init.d/virtualbox

Does anyone know why this is failing?

@divx118
Copy link
Contributor

divx118 commented Jul 20, 2014

You have to disable module locking.

See the /etc/rc.local script https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-%28x86%29#installing-kernel-headersimage

BTW there is another workaround for gcc: error: unrecognized command line option ‘-fstack-protector-strong’ without building gcc 4.9. I have it somewhere written down. I see if I can find it again and post it.

@nullterminated
Copy link
Author

Thanks for the tip. It dawned on me when I woke up this morning that the rc.local wasn't doing the right thing because I didn't have /etc/init.d/vboxdrv. I modified the script to look for /etc/init.d/virtualbox and made it call /sbin/modprobe vboxdrv directly. I had to manually unlock for the initial virtualbox install to work properly as well. Finally, I had to repack the kernel for VT-x. Now I'm able to launch a vm and use vagrant. Thanks for the helpful writeup btw.

@divx118
Copy link
Contributor

divx118 commented Jul 21, 2014

Glad you figured it out.
FYI getting around the gcc error:

So, depending on your gcc you may need to edit arch/x86/Makefile
Line 78 change "stackp-y := -fstack-protector-strong" to stackp-y := -fstack-protector-all

@afturner
Copy link

Hi, I'm having problems installing Virtualbox. I followed the above guide 100% and it just wouldn't work. I'm tech savvy but this kind of stuff can be very confusing.

I have a C720 and I installed crouton using this guide:
http://jeanlouisnguyen.blogspot.com/2014/01/guide-how-to-install-elementary-os-on.html

And the only difference is that it is on my external HD.

My kernel info:
Linux localhost 3.8.11 #1 SMP Thu Aug 7 11:42:15 PDT 2014 x86_64 Intel(R) Celeron(R) 2955U @ 1.40GHz GenuineIntel GNU/Linux

Can someone please give me a simple to understand step by step guide as to where to proceed after I have cloned the correct kernel repo to my home dir?

@divx118
Copy link
Contributor

divx118 commented Aug 30, 2014

For your device you can follow https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-(x86)#installing-x86_64-3811-kernel-headers-from-github
This way you don't need to build them yourself.
Please if you run into problems then post this with the relevant info. So what step went wrong, or what step is confusing.

@afturner
Copy link

Good news and bad news. The kernel issues are gone! Thanks :)

BUT now, I get vt-x errors. Are those resolvable?

Edit: I want to run windows 8.1
I'm installing Windows XP right now and it seems to be running well, so that's good

Edit 2: I looked around and I tried this script:
https://gist.github.com/DennisLfromGA/cd3455530cec2a5a1ef4/download#

I haven't had a chance to boot into the chroot yet (I'm backing it up cause I haven't done that yet)

I will report back..

@afturner
Copy link

Alright I got it working! Thanks everyone :)

@stephen144
Copy link

@nullterminated can you send me your modified rc.local? I was able to install using apt-get but get an error about a missing vboxdrv when I try to run a vm.

@nullterminated
Copy link
Author

@stephenmedina I don't have it any longer. My crouton has been wiped out several times since then. If I remember correctly, I used the mentioned rc.local from

https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-%28x86%29

but replaced references to vboxdrv with virtualbox since that is what was built for me.

@Gothmogz
Copy link

Hi, I'm not that Linux saavy but I have to install XP on a chromebook C720 as well, already installed Crouton.

I have a couple of noob questions just to start.

How do I know my kernel info where it says linux localhost 3.8.11, etc, I want to be sure I'm on 3.8.

Also, everything you do on building your kernel headers, you write that on chromebook console shell or in crouton shell?.

Thanks in advance.

@divx118
Copy link
Contributor

divx118 commented Jan 25, 2015

uname -r should give your kernel version. It is stated in the guide commands need to be executed in the chroot if not mentioned otherwise.
However instead of building the headers yourself you can use https://github.com/divx118/crouton-packages/blob/master/README.md
Please note if you are on dev channel they removed disabling module_locking see #1278

@Gothmogz
Copy link

Ty for the fast answer! and using only the readme.md was actually my next question haha.

@Gothmogz
Copy link

Forgot to ask, in which chroot do I write the commands?, the one on Chromebook or Crouton?

I need to disable module locking and then do everything on the readme.md, right? which means also rebuild the kernel?

@Gothmogz
Copy link

chmod u+w module_locking: Operation not permitted, I have to rebuild kernel with disablevmx?

@Gothmogz
Copy link

Still cant install virtualbox as it doesnt load vbdrv, it says headers are not installed, my device is celeron but when I check the headers info it says architecture amd64, is that an error?

@divx118
Copy link
Contributor

divx118 commented Jan 26, 2015

The script setup-headers.sh need to be run inside the chroot. So on a command line in "crouton" and not the crosh shell. All is taking care of also disabling module_locking, so if you are not on dev channel just run the script setup-headers.sh and install virtualbox. Then logout of your chroot and log back in. Kernel modules should be loaded and you can start using virtualbox.
If this doesn't work for you then open a new issue https://github.com/divx118/crouton-packages/issues and post the output when running the script setup-headers.sh there.
Also post ls -al /sys/module/lsm/parameters/ there.
Architecture is amd64 (64 bit x86) this is correct for your celeron processor.
PS: I prefer taking this to my github, since this has nothing to do with crouton and we don't want to clutter up the issues here.

@Gothmogz
Copy link

Hi!, just made it, thanks a lot for your help and the original tutorial, also the PPA. Works great, now I have Chrome OS and Linux and XP. Is there a way to automate everything?, like turning on the laptop and it runs the shell, calls Crouton and runs VM, etc by itself.?

@DennisLfromGA
Copy link
Collaborator

Autostart crouton chroot at ChromeOS startup
https://github.com/dnschneid/crouton/wiki/Autostart-crouton-chroot-at-ChromeOS-startup

On Mon, Jan 26, 2015 at 4:52 AM, Gothmogz [email protected] wrote:

Hi!, just made it, thanks a lot for your help and the original tutorial,
also the PPA. Works great, now I have Chrome OS and Linux and XP. Is there
a way to automate everything?, like turning on the laptop and it runs the
shell, calls Crouton and runs VM, etc by itself.?


Reply to this email directly or view it on GitHub
#939 (comment).

DennyL@GMail

@splllllitz
Copy link

having similar issues to above.

I followed the kernel building instructions to the T (built kernel 3.8.11) and got this error:

Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

'/etc/init.d/vboxdrv setup'

as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

then used the script posted above (to get 3.10.xx) and arrived at the same .

also:
(trusty)mtp@localhost:~$ sudo /etc/init.d/vboxdrv start
[sudo] password for mtp:
Starting VirtualBox kernel modules ...failed!
(modprobe vboxdrv failed. Please use 'dmesg' to find out why)

dmesg:
[ 3795.659476] Chromium OS LSM: init_module denied module="/lib/modules/3.10.18/misc/vboxdrv.ko" pid=3817 cmdline="/sbin/modprobe vboxdrv"

more:
(trusty)mtp@localhost:~$ sudo /etc/rc.local
[sudo] password for mtp:
chmod: cannot access '/sys/module/lsm/parameters/module_locking': No such file or directory
(trusty)mtp@localhost:~$ sudo chmod 0666 /sys/module/lsm/parameters/module_locking chmod: cannot access '/sys/module/lsm/parameters/module_locking': No such file or directory

@divx118
Copy link
Contributor

divx118 commented Jan 27, 2015

@jewnersey Yes sorry known issue for installing 3.10 kernel headers. Use the steps in this post divx118/crouton-packages#4 (comment)
apt-get install kernel headers fails, because I have no 32bit (i386) version for 3.10 kernel in the repo. I had some problems building it and thought I could leave it out. However apt-get doesn't like that.
I will take some time this weekend to solve that.
However your real problem is to disable module_locking. You will have to use the script from @DennisLfromGA see #1278 (comment) A warning this will disable the verified boot, but will also get you vtx support.
Hopefully we get the sysfs path back soon, so we can disable module_locking again without turning of verified boot.

@splllllitz
Copy link

thanks for all that. making some progress

I used the script, reinstalled VirtualBox, apt-get install dkms (i couldnt used apt-get install virtualbox-dkms because i used the .deb from the website), try and start a vbox and get the same error. went into terminal and loaded the VM kernel module manually, start vbox again, black screen then straight to chrome boot screen.

@divx118
Copy link
Contributor

divx118 commented Jan 28, 2015

@jewnersey Ok, I think you have a problem with the kernel headers you build yourself. Remove/uninstall the installed kernel headers packages you build yourself. Then use the packages from my git repo divx118/crouton-packages#4 (comment)
Rebuild the virtualbox kernel modules and try again.
There seems to be a problem with current kernel source and virtualbox modules. See also #1309

@splllllitz
Copy link

Deleted homemade kernel
purged virtualbox
removed all config and boxes
ran the setup script and installed the 3.10 kernel
reinstalled virtualbox
installed virtualbox extensions
ran sudo /etc/init.d/vboxdrv setup (install vbox dkms)
LOG OUT
sudo startunity
setup up new vbox
START
crash and reboot

@divx118
Copy link
Contributor

divx118 commented Jan 29, 2015

@jewnersey Did you also remove the .deb files you installed linux-image-3.8.11_3.8.11-10.00.Custom_amd64.deb and linux-headers-3.8.11_3.8.11-10.00.Custom_amd64.deb
Also the setup-headers.sh script will not work for you. You will have to do it the manual way see divx118/crouton-packages#4 (comment) You did that by saying "ran the setup script and installed the 3.10 kernel" or did you just run the script setup-headers.sh?
BTW if you installed virtualbox from their site and not from the repo you don't need virtualbox-dkms. Also no dkms needed. Those steps are their to rebuild the modules when installing virtualbox from the ubuntu repo. There is no "/etc/init.d/vboxdrv" file.

@splllllitz
Copy link

-ok so I removed all the .debs.
-purge vbox,etc again
-manually completed those instructions
-install latest vbox from website
-log out
-restart

Failed to open a session for the virtual machine WindowBox.

The virtual machine 'WindowBox' has terminated unexpectedly during startup with exit code 1 (0x1).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Machine
Interface: IMachine {480cf695-2d8d-4256-9c7c-cce4184fa048}


Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

'/etc/init.d/vboxdrv setup'

as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

@divx118
Copy link
Contributor

divx118 commented Jan 29, 2015

@jewnersey Ok, I think you are almost there.

When you run sudo /etc/init.d/vboxdrv setup does it complete without errors? If you got an error, please post the log file it refers to.

Can you also post cat /etc/rc.local?

And cat /proc/cmdline

Since you cannot write the sysfs path to disable module_locking, you will need to remove those lines from rc.local. If you don't do that rc.local will fail to execute. Below is an example how rc.local for you should look like.
/etc/rc.local

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

# umount bindmounts /lib/modules from enter-chroot
for m in `cat /proc/mounts | /usr/bin/cut -d ' ' -f2 | grep /lib/modules| grep -v "^/$" `; do
        umount "$m"
done

# load vboxdrv
if [ `find /lib/modules/"\`uname -r\`" -name vboxdrv.ko` ]; then
    modprobe vboxdrv
    modprobe vboxpci
    modprobe vboxnetadp
    modprobe vboxnetflt
fi

exit 0

@splllllitz
Copy link

setup fails

45.294392] warning: `VirtualBox' uses 32-bit capabilities (legacy support in use)
[ 58.165603] systemd-logind[15742]: New session c3 of user root.
[ 58.239748] systemd-logind[15742]: Removed session c3.
[ 187.935089] Chromium OS LSM: init_module denied >module="/lib/modules/3.10.18/misc/vboxdrv.ko" pid=19258 cmdline="/sbin/modprobe >vboxdrv"

my rc.local is identical to yours.

(trusty)mtp@localhost:~$ cat /proc/cmdline
cros_secure console= loglevel=7 init=/sbin/init cros_secure oops=panic panic=-1 >root=/dev/dm-0 rootwait ro dm_verity.error_behavior=3 dm_verity.max_bios=-1 >dm_verity.dev_wait=1 dm="1 vroot none ro 1,0 2506752 verity >payload=PARTUUID=5980f6ca-5a1e-7c4a-8bba-4aeae8558d34/PARTNROFF=1 >hashtree=PARTUUID=5980f6ca-5a1e-7c4a-8bba-4aeae8558d34/PARTNROFF=1 >hashstart=2506752 alg=sha1 >root_hexdigest=91129b547b1565b92df8ce7798675c29ddb0176c >salt=3f417b72b36daa93fa262f4890a412f5a4eba135e712af3ab1345ff0357aeeb5" >noinitrd cros_debug vt.global_cursor_default=0 kern_guid=5980f6ca-5a1e-7c4a-8bba->4aeae8558d34 add_efi_memmap boot=local noresume noswap i915.modeset=1 >tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic

@divx118
Copy link
Contributor

divx118 commented Jan 30, 2015

@jewnersey
I think you didn't run this script from @DennisLfromGA to disable module_locking and turn disablevmx off, because I don't see it in your kernel cmdline. Modules will fail to load.
Note: Running that script will also disable verified boot, so you will have a less secure system.

@splllllitz
Copy link

ran the script from chronos
started chroot
ran virtualbox.
tried to start windows box - immediate black screen and reboot

@divx118
Copy link
Contributor

divx118 commented Feb 1, 2015

@jewnersey Sorry I am out of options then. I have no chromebook here with the newer 3.10 kernel so I could see if I can replicate it. You would need to look at dmesg or cat /proc/kmsg and see what is causing the kernel panic. At least that is what I assume happens when the chromebook reboots.
You could also try playing with the settings in virtualbox IIRC there was something about the network that would cause this. Default it is set to NAT, try setting it to bridged.

@splllllitz
Copy link

thanks for trying!

@adrianahdez
Copy link

adrianahdez commented Dec 30, 2019

Does anyone know why this is failing?

For those who didn’t find a solution of this issue here. I’ve just posted the solution here:

https://askubuntu.com/questions/760671/could-not-load-vboxdrv-after-upgrade-to-ubuntu-16-04-and-i-want-to-keep-secur/1199583#1199583

Hope this helps someone :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants