Ubuntu with xhyve on MacOS - mofm/xhyve GitHub Wiki
1.Create a cloned ISO file named /tmp/tmp.iso of ubuntu-16.04.1-server-amd64.iso disk.
$ dd if=/dev/zero bs=2k count=1 of=/tmp/tmp.iso
$ dd if=ubuntu-16.04.1-server-amd64.iso bs=2k skip=1 >> /tmp/tmp.iso
2.Mount the ISO file:
$ hdiutil attach /tmp/tmp.iso
3.Copy the necessary files to working directory.
$ cp /Volumes/Ubuntu-Server\ 14/install/vmlinuz $WORKING_DIRECTORY
$ cp /Volumes/Ubuntu-Server\ 14/install/initrd.gz $WORKING_DIRECTORY
4.Create virtual hard disk drive.
$ mkfile 5g ubuntu.img
5.start up script for Ubuntu installation
$ ./ubuntu_install.sh
6.When you reach “Installation complete” screen, select “Go back” and choose “Execute a shell” to config copy installed kernel and initrd to Host working directory.
show Ubuntu IP address:
$ sbin/ifconfig
start to transfer boot directory:
$ tar c | nc -l -p 1234
7.On the Host working directory:
$ nc [IP] 1234 | tar x
and finally
8.Run ubuntu_boot.sh script and boot ubuntu:
$ ./ubuntu_boot.sh