Git Product home page Git Product logo

xhyve-ubuntu's Introduction

macOS Ubuntu

Install an Ubuntu 16.04 VM on macOS using xhyve.

Install xhyve

brew install xhyve

Get booting kernel

./prepare.sh ~/Downloads/ubuntu-16.04.1-server-amd64.iso

Create storage and boot to ISO

sudo ./create.sh ~/Downloads/ubuntu-16.04.1-server-amd64.iso

After booting, install Ubuntu just like you normally would.

Pro tip: Don't resize your terminal while you're going through the installer.

When you get to this question.

Install the GRUB boot loader to the master boot record?

Make sure you say, "yes".

Grab newer kernel from install

When you get to "Installation complete", select "Go Back". Then, "Execute a shell".

Find your current IP address.

/sbin/ip addr show enp0s2
2: enp0s2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    inet 192.168.64.8/24 brd 192.168.64.255 scope global enp0s2

Next, we're gonna copy some files back to the host. The exact name of the following files might be slightly different, depending on when you download the Ubuntu server ISO.

In the guest, run this.

cd /target/boot
cat initrd.img-4.4.0-31-generic | nc -l -p 1234
cat vmlinuz-4.4.0-31-generic | nc -l -p 1234

On the host, run this.

cd boot/
nc 192.168.64.8 1234 > initrd.img-4.4.0-31-generic
nc 192.168.64.8 1234 > vmlinuz-4.4.0-31-generic
cd ../

Now, you can exit the shell and finish the installation.

Start your new OS

sudo ./start.sh

First steps

Here are some things you should probably do after logging in.

sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get install -y xterm
echo "export TERM=xterm-256color" >> $HOME/.bashrc

xterm is important because it'll install the resize command. You'll need to manually resize the terminal dimensions because we're using a serial TTY or something.

The default terminal is vt220, which doesn't have colors by default. We're probably more used to xterm.

Everytime you resize your terminal, you need to run resize. Otherwise, your output will get jacked.

Reboot

That's it! You don't really need to reboot, but here's what that looks like.

jaime@xhyve:~$ sudo poweroff
[  636.675689] reboot: System halted
jaime@mac:~$ sudo ./start.sh

Launch Daemons

sudo chown root variadico.xhyve.ubuntu.plist
sudo ln -s $(pwd)/variadico.xhyve.ubuntu.plist /Library/LaunchDaemons/
sudo launchctl load /Library/LaunchDaemons/variadico.xhyve.ubuntu.plist

# Verify status
sudo launchctl list | grep "xhyve"

# Stop
sudo launchctl unload /Library/LaunchDaemons/variadico.xhyve.ubuntu.plist

xhyve-ubuntu's People

Contributors

elazarl avatar rimusz avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.