https://chromium.googlesource.com/chromiumos/platform/crosvm
https://www.collabora.com/news-and-blog/blog/2017/11/09/quick-hack-experiments-with-crosvm/
You can also bypass this and use installed ubuntu kernel image on your ubuntu.
cd ~/src
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
cd linux
git checkout v4.12
#make x86_64_defconfig
#make bzImage
cp /boot/config-$(uname -r) .config
make oldconfig # choosing all default options is fine
make -j8 deb-pkg
sudo dpkg -i ../linux-image-4.12.0_4.12.0-2_amd64.deb # install initrd.img and vmlinuz
cd ..
cd ~/project/vm/
git clone https://android.googlesource.com/platform/external/minijail
cd minijail
make
cd ..
sudo apt-get install libusb-1.0-0-dev libfdt-dev
# suppose you wish to clone everything about crosvm into ~/project/vm/chrome, clone adhd first
mkdir -p ~/project/vm/chrome/third_party/
cd ~/project/vm/chrome/third_party/
git clone https://chromium.googlesource.com/chromiumos/third_party/adhd
mkdir -p ~/project/vm/chrome/platform/
cd ~/project/vm/chrome/platform/
git clone https://chromium.googlesource.com/a/chromiumos/platform/crosvm
cd crosvm
LIBRARY_PATH=~/project/vm/minijail cargo build
cd ~/src/crosvm
dd if=/dev/zero of=rootfs.ext4 bs=1K count=1M
mkfs.ext4 rootfs.ext4
mkdir rootfs/
sudo mount rootfs.ext4 rootfs/
debootstrap testing rootfs/
sudo umount rootfs/
Change root password
chroot rootfs
unshare -m bash
mount --make-rslave /
passwd root
# might have to fsck when starting vm at next step
fsck /dev/vda
Please update initrd.img-4.13.0-46-generic
and vmlinuz-4.13.0-46-generic
with previous installed kernel or installed ubuntu kernel if necessary
sudo LD_LIBRARY_PATH=~/project/vm/minijail/ ./target/debug/crosvm run --disable-sandbox --rwroot rootfs.ext4 --seccomp-policy-dir=./seccomp/x86_64/ -i /boot/initrd.img-4.13.0-46-generic /boot/vmlinuz-4.13.0-46-generic