Skip to content

Instantly share code, notes, and snippets.

@komuw
Last active April 11, 2024 23:33
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save komuw/10992190 to your computer and use it in GitHub Desktop.
Save komuw/10992190 to your computer and use it in GitHub Desktop.
How To enable VT-x support in chromebook
Generously taken from this discussion; https://github.com/dnschneid/crouton/issues/675
They've created a wiki: https://github.com/dnschneid/crouton/wiki/Repack-kernel-to-Enable-VT_x-for-Virtualbox
You should check it out to see if anything has changed.
A. first of all install virtualbox correctly: https://gist.github.com/komuW/10991598. then;
1.Open a shell on your Chrome OS
ie while in in chromeOS; open browser, then ctrl+alt+T, then type shell, then press enter
2.Disable verified boot :
(You could do this later, but you have to do this before step 10. It won't boot up otherwise.)
$ sudo crossystem dev_boot_signed_only=0
3.Change current directory to Downloads as a temporary folder:
$ cd ~/Downloads/
4.Copy the existing kernel into a file:
$ sudo dd if=/dev/sda2 of=kernel2
$ sudo dd if=/dev/sda4 of=kernel4
5.Get the kernel configuration:
$ vbutil_kernel --verify kernel2 --verbose | tail -1 > vmxoff-config2.txt
$ vbutil_kernel --verify kernel4 --verbose | tail -1 > vmxoff-config4.txt
6.Add 'disablevmx=off' to the config line:
$ sed -i -e 's/$/ disablevmx=off/' vmxoff-config2.txt
$ sed -i -e 's/$/ disablevmx=off/' vmxoff-config4.txt
7.Repack the kernels:
$ vbutil_kernel --repack repacked2 --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk --keyblock /usr/share/vboot/devkeys/kernel.keyblock --oldblob kernel2 --config vmxoff-config2.txt
#ie in one line
$ vbutil_kernel --repack repacked4 --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk --keyblock /usr/share/vboot/devkeys/kernel.keyblock --oldblob kernel4 --config vmxoff-config4.txt
#another one line
8.Verify the new kernels (You should see Body verification succeeded):
$ vbutil_kernel --verify repacked2 --verbose
$ vbutil_kernel --verify repacked4 --verbose
9.Copy the kernels back:
$ sudo dd if=repacked2 of=/dev/sda2
$ sudo dd if=repacked4 of=/dev/sda4
10.Reboot, and enjoy VT-x extensions
#NB: you should reboot the whole computer, ie the chromeOS.
@VhatAmI
Copy link

VhatAmI commented Apr 13, 2016

This is great thanks, was curious if you know how to get the kvm modules into a chroot? I've been working at it for days with 0 luck

@lukchen
Copy link

lukchen commented Nov 6, 2017

I met this problem
$ sudo dd if=/dev/sda2 of=kernel2
dd: failed to open '/dev/sda2': No such file or directory
then I checked this:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 1.7G 1.2G 578M 67% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmp 1.9G 1.9G 2.2M 100% /tmp
run 1.9G 624K 1.9G 1% /run
shmfs 1.9G 22M 1.9G 2% /dev/shm
/dev/mmcblk0p1 11G 4.8G 5.1G 49% /mnt/stateful_partition
/dev/mmcblk0p8 12M 28K 12M 1% /usr/share/oem
/dev/mapper/encstateful 3.1G 123M 3.0G 4% /mnt/stateful_partition/encrypted
media 1.9G 0 1.9G 0% /media
tmpfs 128K 12K 116K 10% /run/crw
/dev/sdb1 228G 6.3G 210G 3% /media/removable/Sandisk 1
media 1.9G 0 1.9G 0% /media/removable/Sandisk 1/chroots/xenial/var/host/media
/dev/sdb1 228G 6.3G 210G 3% /media/removable/Sandisk 1/chroots/xenial/var/host/media/removable/Sandisk 1
I used crouton installed ubuntu in external USB storage.
There is no sda2/sda4, then I tried $ sudo dd if=/dev/root of=kernel, it didn't work.
Can you help me how to continue?

@vincentsmh
Copy link

Hi there ~
I have ASUS Chromebook Flip C302ca. I can execute all the procedure without error. However, when I reboot the system and check if it turns VMX on by commands

$ sudo modprobe msr
$ sudo rdmsr 0x3A

It returns 1 (vmx is disabled).
But by cat /proc/cmdline, I can see disablevmx=off.

Do you know what is the problem?

@mathieucarbou
Copy link

mathieucarbou commented Apr 26, 2018

ASUS Chromebook Flip C302CA:

I ran the steps, but now I cannot reboot. Chromebook kept looping in the "OS verification is turned OFF" screen. I had to press space to turn back on verification. Now I have this "chrome os is missing or damaged":

img_20180426_135327

@Noisytoot
Copy link

@mathieucarbou To get past the OS Verification is off screen either press CTRL+D or wait 30 seconds and you now need to recover from a USB Drive

@Zachat6
Copy link

Zachat6 commented Jul 15, 2021

I met this problem
$ sudo dd if=/dev/sda2 of=kernel2
dd: failed to open '/dev/sda2': No such file or directory
then I checked this:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 1.7G 1.2G 578M 67% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmp 1.9G 1.9G 2.2M 100% /tmp
run 1.9G 624K 1.9G 1% /run
shmfs 1.9G 22M 1.9G 2% /dev/shm
/dev/mmcblk0p1 11G 4.8G 5.1G 49% /mnt/stateful_partition
/dev/mmcblk0p8 12M 28K 12M 1% /usr/share/oem
/dev/mapper/encstateful 3.1G 123M 3.0G 4% /mnt/stateful_partition/encrypted
media 1.9G 0 1.9G 0% /media
tmpfs 128K 12K 116K 10% /run/crw
/dev/sdb1 228G 6.3G 210G 3% /media/removable/Sandisk 1
media 1.9G 0 1.9G 0% /media/removable/Sandisk 1/chroots/xenial/var/host/media
/dev/sdb1 228G 6.3G 210G 3% /media/removable/Sandisk 1/chroots/xenial/var/host/media/removable/Sandisk 1
I used crouton installed ubuntu in external USB storage.
There is no sda2/sda4, then I tried $ sudo dd if=/dev/root of=kernel, it didn't work.
Can you help me how to continue?

I got the same problem.

@USMP-lancer
Copy link

I met this problem
$ sudo dd if=/dev/sda2 of=kernel2
dd: failed to open '/dev/sda2': No such file or directory
then I checked this:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 1.7G 1.2G 578M 67% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmp 1.9G 1.9G 2.2M 100% /tmp
run 1.9G 624K 1.9G 1% /run
shmfs 1.9G 22M 1.9G 2% /dev/shm
/dev/mmcblk0p1 11G 4.8G 5.1G 49% /mnt/stateful_partition
/dev/mmcblk0p8 12M 28K 12M 1% /usr/share/oem
/dev/mapper/encstateful 3.1G 123M 3.0G 4% /mnt/stateful_partition/encrypted
media 1.9G 0 1.9G 0% /media
tmpfs 128K 12K 116K 10% /run/crw
/dev/sdb1 228G 6.3G 210G 3% /media/removable/Sandisk 1
media 1.9G 0 1.9G 0% /media/removable/Sandisk 1/chroots/xenial/var/host/media
/dev/sdb1 228G 6.3G 210G 3% /media/removable/Sandisk 1/chroots/xenial/var/host/media/removable/Sandisk 1
I used crouton installed ubuntu in external USB storage.
There is no sda2/sda4, then I tried $ sudo dd if=/dev/root of=kernel, it didn't work.
Can you help me how to continue?

I got the same problem.

there seems to be a theme here h

@elkawai621
Copy link

in the part of the dd commands they only work when I have a connected sd with ubuntu installed, but when it is not connected it says that kernel2 was not found, Very SUS

@dimitrik94
Copy link

in the part of the dd commands they only work when I have a connected sd with ubuntu installed, but when it is not connected it says that kernel2 was not found, Very SUS

Could you please explain more detail on this step?

@Pearostester
Copy link

im Not Fucking Trying This if This is Damaging Chromebooks Hell Nah 0 Out of 10

@gufuskn
Copy link

gufuskn commented Feb 24, 2024

@Zachat6
Try using "/dev/mmcblk*" instead of "/dev/sd*"
Use the df and fdisk command just in case

@YeesterPlus
Copy link

do recovery key combo and then do ctrl+d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment