DEV Community

Cover image for How to install Virtual Box in ChromeOS
Akhil Naidu
Akhil Naidu

Posted on • Originally published at blog.leewardslope.com

Virtualbox on Chromebook How to install Virtual Box in ChromeOS

In this guide, I assume you are familiar with @sebanc brunch, Crouton, Chroot and obviously Virtualbox. If you are not familiar with anyone of these first go through the following links and get a brief idea for conceptual clearance in your head.

These are the steps we cover in this Guide.

  • [x] Install ChromeOS in your PC

  • [x] Installing a Chroot based Ubuntu Instance

  • [x] Setting up the Environment in Ubuntu

  • [x] Installing Virtual Box

Installing ChromeOS in your PC

I guess you are familiar with the Brunch of this master branch, with which you can use Install the ChromeOS in any PC - provided your PC meets the hardware requirements.

Any quires in this section, you are free to browse through the existing issues or to open a new issue.

Installing a Chroot based Ubuntu Instance

Follow these instructions, in case of any errors stop it - do some research or comment it below.

  1. Download crouton
  2. Open a shell (Ctrl+Alt+T, type shell, and hit enter)
  3. Copy the installer to an executable location by running sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton
  4. Now that it's executable, run the installer itself: sudo crouton -r xenial -t xfce
  5. Wait patiently and answer the prompts like a good person. At the end of the installation you need to provide username and password for ubuntu installation.
  6. Done! You can jump straight to your Xfce session by running sudo enter-chroot startxfce4 or, as a special shortcut, sudo startxfce4
  7. Cycle through Chromium OS and your running graphical chroots using Ctrl+Alt+Shift+Back(F1) and Ctrl+Alt+Shift+Forward(F2).
  8. Exit the chroot by logging out of Xfce.

Step 6,7,8 are optional steps, which will provide you an idea about the usage of crouton

Setting up the Environment in Ubuntu

After successful completion of Step 5, you can launch the Ubuntu using Xfce using Step 6 or you can use this command: sudo enter-chroot to access the Ubuntu terminal. It's up to you how you want to access the Ubuntu terminal.

In ubuntu terminal, use this command before installing anything. sudo mount -o remount,rw /lib/modules/*

Installing Virtual Box

The above step, which focuses on setting up of environment is a must. The command: sudo mount -o remount,rw /lib/modules/* should be executed without any error. If you have no error proceed further.

crostini needs to be disabled in ChromeOS settings

  1. sudo apt install virtualbox to install VirtualBox
  2. Before using VirtualBox, run sudo modprobe vboxdrv

We are all set, now you have a working VirtualBox in ChromeOS, If you have any suggestion or issue feel free to comment.


for new updates visit: https://blog.leewardslope.com/how-to-install-virtualbox-in-chromeos/

Top comments (12)

Collapse
 
liamcortes1 profile image
Liam Cortes

well this is want happened

.charles@penguin:~$ shell
-bash: shell: command not found
charles@penguin:~$ sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton
install: cannot stat '/home/charles/Downloads/crouton': No such file or directory
charles@penguin:~$ sudo crouton -r xenial -t xfce
sudo: crouton: command not found
charles@penguin:~$ sudo apt-get crouton
E: Invalid operation crouton
charles@penguin:~$ sudo apt-get install crouton
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package crouton
charles@penguin:~$ sudo mount -o remount,rw /lib/modules/*
mount: /lib/modules/*: mount point does not exist.
charles@penguin:~$ sudo mount -o remount,rw /lib/modules/
mount: /lib/modules/: mount point does not exist.
charles@penguin:~$ sudo apt install virtualbox
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package virtualbox
charles@penguin:~$ sudo modprobe vboxdrv
modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/5.4.88-12224-gf05236dbdecf
charles@penguin:~$ sudo apt install virtualbox
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package virtualbox
charles@penguin:~$

Collapse
 
idkwutsmyname profile image
idkwutsmyname

Dude enable dev mode that literally fixes all the problems. Check their git hub page README section

Collapse
 
joris_vaneijk_4a4b8416f4 profile image
joris van eijk

well this is what happend

vaneijkjoris320@penguin:~$ shell
-bash: shell: command not found
vaneijkjoris320@penguin:~$ ^[[200~shell~
-bash: $'\E[200~shell~': command not found
vaneijkjoris320@penguin:~$ sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton~
install: cannot stat '/home/vaneijkjoris320/Downloads/crouton~': No such file or directory
vaneijkjoris320@penguin:~$ shell
-bash: shell: command not found
vaneijkjoris320@penguin:~$ sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton
install: cannot stat '/home/vaneijkjoris320/Downloads/crouton': No such file or directory
vaneijkjoris320@penguin:~$

Collapse
 
joris_vaneijk_4a4b8416f4 profile image
joris van eijk

same happened to me
crosh> shell
ERROR - ERROR: unknown command: shell
crosh> sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton
ERROR - ERROR: unknown command: sudo
crosh> install -Dt /usr/local/bin -m 755 ~/Downloads/crouton
ERROR - ERROR: unknown command: install

Collapse
 
bepetersn profile image
Brian Everett Peterson • Edited

After sudo enter-chroot and attempting to run the mount command, I received:

mount: cannot remount /dev/mapper/vroot read-write, is write-protected

Can you advise?

Collapse
 
akhilnaidu profile image
Akhil Naidu

I could not point out your issue clearly because of less information, but one thing is for certain, your user account was not given access. I have two suggestive solutions for you.

The first one is to do everything after having admin access rather than through sudo privileges, i.e, use sudo su and repeat the process without sudo.

If you don't want to use your root account, I would suggest you go through this alternative.
sudo disable_verity and reboot your machine sudo reboot and retry the process.

Have a look at what disable_verity does, because many of the users are facing problems in apps like Libre Documents and Microsoft Excel or other Doc related Applications.

Collapse
 
joris_vaneijk_4a4b8416f4 profile image
joris van eijk

shell cant be found

Collapse
 
joris_vaneijk_4a4b8416f4 profile image
joris van eijk

ERROR - ERROR: unknown command: shell

Collapse
 
joris_vaneijk_4a4b8416f4 profile image
joris van eijk

i cant do something with sudo

Collapse
 
joris_vaneijk_4a4b8416f4 profile image
joris van eijk

crosh> [200~sudo disable_verity
ERROR - ERROR: unknown command: sudo
crosh>

Collapse
 
user3781234 profile image
giococancramaro

so at the end of installation it asks me for user and password, i created the user but i didnt create the password since it didnt let me type it and now i cant put sudo commands

Collapse
 
joris_vaneijk_4a4b8416f4 profile image
joris van eijk

did it in chromeos 130.0.6723.126
up to date