Setting up a Chrome OS VM in VirtualBox

It's really easy to setup a virtual machine instance of ChromeOS for testing and configuration before making the financial commitment (albeit small) to a cutting edge Chromebook.

Part of my desire for figuring out how to setup a virtual machine is that one of my clients has a very tightly controlled VPN to access and edit the files on their file system. Currently, they use the OpenVPN "appliance" as one of the Google Compute Engine instances. While I'm able to use the OpenVPN client on my Mac computer, I wasn't really sure how this work on a Chrome OS based system, although I assumed this is something Google wants their cloud clients to be able to do.

I started out looking at the Chromium OS code repo online, as I thought I would build and compile the source myself. but after trying to figure out what repo tools I needed, I assumed there must be a better (easier) option, since I really didn't desire to change the code, just experiment with the operating system. The download size of the repo itself is massive – I gave up around 1.9GB.

I also remember that Hexxah used to host Chromium OS builds on his blog, but it appears that he no longer maintains this information, nor does he provide builds.

I found that NeverWare's CloudReady software was a possible solution – it's based on the Chromium OS source – and once I filtered through all the license options, I figured out their Home Edition was the best solution for what I needed given it's cost (FREE!) and it's personal license (I don't need this for business, yet). The 64-bit image file comes as a zip and you'll also need to install the Chromebook Recovery Utility (this is the same extension for both macOS and Windows). Unfortunately, there's just not a good way around using a usb drive, as the recovery utility can only "see" flash drives. The unpack and recovery disk process take about 20 minutes, depending on the relative speed of the computer.

CREATE THE RECOVERY DISK

After installing the Chromebook Recovery Utility, you'll need to create a recovery disk. Open the Chromebook recovery Utility from your Chrome apps. In the window that opens click on the settings (gear) icon in the upper right hand corner of the app and choose "Use Local Image" from the menu

Once you've create your boot (recovery) USB drive, you need to do some additional steps to allow you to clone the USB to a vdmk image (thanks to Sebastian Han for the following steps):

$ diskutil list

/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *525.1 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_HFS Macintosh HD 524.3 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3

/dev/disk2 (external, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *8.0 GB disk2

1: Microsoft Basic Data 1.3 GB disk2s16

2: FE3A2A5D-4F32-41A7-B725-ACCC3285A309 16.8 MB disk2s17

3: 3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC 3.2 GB disk2s18

4: FE3A2A5D-4F32-41A7-B725-ACCC3285A309 16.8 MB disk2s19

5: 3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC 2.1 MB disk2s20

6: Microsoft Basic Data 1.1 GB disk2s23

7: CAB6E88E-ABF3-4102-A07A-D4BB9BE3C1D3 8.4 MB disk2s26

8: EFI EFI-SYSTEM 16.8 MB disk2s27

In this case my USB drive was located at /dev/disk2, it may take some sleuthing to figure exactly which disk is the correct one if you have multiple partition and mounted drives. Make sure the disk is unmounted.

$ diskutil unmountDisk /dev/disk2

Unmount of all volumes on disk2 was successful

You'll also need to change permissions on the device before cloning the disk. It should go without saying, but the use of sudo should be reserved for only those users who know what they are doing to their computer and could cause irrepairable damage to their personal computer.

$ sudo chown $USER /dev/disk2

Then you're ready to clone your USB drive!

$ VBoxManage internalcommands createrawvmdk -rawdisk /dev/disk2 -filename ~/Chrome-Boot.vmdk

RAW host disk access VMDK file /Users/******/Chrome-Boot.vmdk created successfully.

CREATE THE VIRTUAL MACHINE

While setting up the virtual machine at this point should be the easiest part, it took some trial and error on my part to get it to boot correctly and allow me to install the OS on a virtual drive.

SETTINGS OVERVIEW

The following settings worked consistently for me, but you may need to experiment...

  • General: Other, Other/Unknown (64-bit)

  • System: 2GB RAM (It should probably be more), "Enable I/O APIC" and "Enable EFI (special OSes only)" checked - EFI appears to be required for Chromium OS.

  • Screen: 64MB, "Enable 3D Acceleration" checked.

I went ahead and created an empty VDI disk to load the OS onto once I was able to boot to it. It's not imperative to do it at this point, but you will need it to load the image permanently into your machine.

BOOT CHROMIUM OS

Here's the tricky part. I couldn't figure out how to "hack" the boot order of the EFI without getting dumped to the EFI shell (I sure wasn't going to use that!). So I did the next best thing; I created my boot disk as the primary master, and the empty VDI as the primary slave (which kinda made me feel like I was back in 1993). This forced Virtualbox to boot from the boot disk clone. Once the system booted up (which took a good five minutes) all I needed to do was choose "Install Cloudready" from the user menu in Chromium OS. While the process says it only takes about 20 minutes, on my end it took around 40. The recovery system was real choppy in performance. Once CloudReady has been installed, it will turn off the appliance. Then all you need to do is remove the boot media from the devices list in Virtualbox settings for the machine and then change your once empty Chromium VDI to be the primary master. The installed version took about 4GB of disk space, so plan your storage needs appropriately.

SO, WHAT ABOUT OPENVPN...

Still working on that one... but I should know soon what the solution is.