Dear list,
Recently I came into possession of a Cubieboard 2
(Thanks Anil!) and set out to
install Xen/Mirage guided by the following sets of
instructions:
TL;DR: The link to the pre-built binaries in [1] is
broken, but building from
source I was able to successfully install mirage on
the Cubieboard and run the
UNIX version of the Hello, World! unikernel.
However, the Xen version did not
work because the opam package mirage-xen 1.1.1 did
not compile (some command
line options were not recognized by cc). The full
build log is at
It seems that this problem should be quite easy to
solve by someone more
knowledgeable than me.
I am also sharing the exact steps I took to set up
the Cubieboard in case they
are of use to someone else.
Best wishes,
Nicolas
How to install Xen/Mirage on a Cubieboard 2
-------------------------------------------
This is a record of what I had to do to install Xen
on a Cubieboard 2. I am
sending it to the list in case it is of use to
someone else.
Before we start, ingredients:
- MacBook Pro, Early 2011, OS X 10.9.4, 8GB
RAM.
- Cubieboard 2.
So, let's get started.
Click on the link that advertises a
pre-built binary for the cubieboard2
and realize that it is not working. We
have to build from source.
VirtualBox 4.3.16 for OS X hosts). Run the
provided installer.
Save the image
ubuntu-14.04.1-server-amd64.iso somewhere where you
can
find it.
Step 4: In VirtualBox, create a new vm (OS Type:
Ubuntu 64-bit).
I assigned 2GB RAM (out of a total of 8GB)
and 8GB Hard drive (this
turned out to be extremely tight to build
xen-arm-builder, so I
recommend making it at least 9GB to give
yourself some more room).
When prompted for an installation CD,
locate the ISO file that you
downloaded in Step 3.
Step 5: Follow the prompts and install Ubuntu.
Make sure to install sshd when prompted (we
want to avoid having to use
the VirtualBox UI at all costs).
Step 6: (Optional?) Fix the Wi-Fi in VirtualBox.
For some reason the network speeds in
VirtualBox would start up ok and
then suddendly slow down to a crawl. After
some googling and some blind
guessing I could solve it for my setup.
Simply go to Settings > Network and
change the drop-down menu 'Attached
to:' from 'NAT' to 'en1: Wi-Fi (AirPort)'.
Click OK and restart the VM.
Log in and type 'ifconfig'. Note the 'inet
addr' of the 'eth0' interface.
Step 7: SSH into the VM from your normal (OS X)
terminal.
Open a terminal and type 'ssh
<user>@<ip>' where <ip> is the
address
from the previous step. Log in.
Step 8: Install git and clone xen-arm-builder from
github.
sudo apt-get install git
cd xen-arm-builder
Step 9: Follow the instructions in the
xen-arm-builder README.
export BOARD=cubieboard2
make clone
make build
make cubieboard2.img
# Exit the ssh session
exit
# Get the cubieboard2.img file over to the
OS X side
scp
<user>@<ip>:xen-arm-builder/cubieboard2.img
.
# Insert SDcard into your computer and copy
the .img file into it
# Find the disk device of the card you
inserted, say diskN
sudo diskutil list
# Unmount the disk images
sudo diskutil unmountDisk /dev/diskN
# Copy the image - This automatically
remounts the disk
sudo dd if=cubieboard2.img of=/dev/rdiskN
bs=64k
# Unmount the image and eject
sudo diskutil unmountDisk /dev/diskN
# Insert SDcard into Cubieboard, connect
the Cubieboard power & network.
# The cubieboard will obtain an IP address
via DHCP and will also
# broadcast itself on Bonjour (Zeroconf)
under the name
# 'cubieboard2.local.' (note the dot at the
end). So you should be able
# to connect the cubieboard to your local
network with an ethernet cable
# and then do
# (password is 'mirage') and voila! you're
connected.
Step 10: Install Mirage.
# except that we can skip the first
section, 'Requirements'.
opam init
eval `opam config env`
opam install mirage
Step 11: Build Hello, World! example, UNIX version.
cd mirage-skeleton
cd console
mirage configure --unix
make depend
make
./mir-console
Step 12: Build Hello, World! example, Xen version
[FAILED!].
mirage configure --xen
Fails while compiling mirage-xen 1.1.1
with the C compiler cc
complaining about some unrecognized
command line options
cc: error: unrecognized command line
option ‘-m64’
cc: error: unrecognized command line
option ‘-mno-red-zone’
cc: error: unrecognized command line
option ‘-momit-leaf-frame-pointer’
cc: error: unrecognized command line
option ‘-mfancy-math-387’