Category Archives: Uncategorized

KVM Forum 2015

Assuming HMG can get my passport back to me in time, I am speaking at the KVM Forum 2015 in Seattle USA (full schedule of talks here).

I’m going to be talking about virt-v2v and new features of qemu/KVM that made it possible for virt-v2v to be faster and more reliable than ever.

Leave a comment

Filed under Uncategorized

Booting RISC-V Linux with qemu

There are various open source ISAs and chip designs. I’ve previously run OpenRISC 1200 on an FPGA. Another effort is the RISC-V (“RISC Five”) project, which is developing an open, patent-free 64 bit ISA. It has a sister project lowRISC which aims to produce a synthesizable RISC-V FPGA design “in 6 months”, and tape out by the end of this year (I’m a little skeptical of the timeframes).

RISC-V has added support to a fork of qemu:

$ git remote add riscv https://github.com/riscv/riscv-qemu
$ git fetch riscv
$ git checkout -b riscv-master --track riscv/master
$ ./configure --target-list="riscv-softmmu"
$ make
$ ./riscv-softmmu/qemu-system-riscv -cpu \?
RISCV 'riscv-generic'
$ ./riscv-softmmu/qemu-system-riscv -machine \?
Supported machines are:
board                RISCV Board (default)
none                 empty machine

To save yourself a world of pain, download a RISC-V Linux kernel binary and root image from here.

$ file ~/vmlinux
/home/rjones/vmlinux: ELF 64-bit LSB executable, UCB RISC-V, version 1 (SYSV), statically linked, BuildID[sha1]=d0a6d680362018e0f3b9208a7ea7f79b2b403f7c, not stripped

Then you can boot the image in the usual way:

$ ./riscv-softmmu/qemu-system-riscv \
    -display none \
    -kernel ~/vmlinux \
    -hda ~/root.bin \
    -serial stdio

The root filesystem is very sparse:

# uname -a
Linux ucbvax 3.14.15-g4073e84-dirty #4 Sun Jan 11 07:17:06 PST 2015 riscv GNU/Linux
# ls /bin
ash       chgrp     dd        ln        mv        rmdir     touch
base64    chmod     df        ls        nice      sleep     true
busybox   chown     echo      mkdir     printenv  stat      uname
cat       cp        false     mknod     pwd       stty      usleep
catv      date      fsync     mount     rm        sync
# ls /sbin
init
# ls /usr/bin
[          dirname    groups     mkfifo     sha1sum    tac        uniq
[[         dos2unix   head       nohup      sha256sum  tail       unix2dos
basename   du         hostid     od         sha3sum    tee        uudecode
cal        env        id         printf     sha512sum  test       uuencode
cksum      expand     install    readlink   sort       tr         wc
comm       expr       logname    realpath   split      tty        whoami
cut        fold       md5sum     seq        sum        unexpand   yes

Obligatory comic strip

Leave a comment

Filed under Uncategorized

Boingboing banned me

Tip: Don’t complain about Boingboing posting affiliate links without disclosing them, something that is now illegal under US law. You’ll get a year long ban and a pithy message:

Screenshot - 100615 - 11:17:57

There were not “multiple complaints” – I checked and nothing was said on the thread at all. It’s just a moderator instantly banning people who talk about affiliate links, the way that the site earns most of its revenue, and something they don’t want to discuss at all.

I thought the New Economy was supposed to be about having a “Conversation”? Guess the New Economy isn’t that much different from the old economy after all.

1 Comment

Filed under Uncategorized

Fedora 22 aarch64 virt-builder image

Fedora 22 was released today for x86, and almost simultaneously for aarch64. I have already built a virt-builder image, so you can install it immediately (either on real hardware or under virtualization on x86):

$ virt-builder --arch aarch64 fedora-22

To boot this on x86, use a slightly modified version of the instructions from here:

$ wget http://libguestfs.org/download/builder/fedora-22-aarch64-nvram.xz
$ unxz fedora-22-aarch64-nvram.xz
$ qemu-system-aarch64 -nodefconfig -nodefaults -display none \
    -M virt -cpu cortex-a57 -machine accel=tcg \
    -m 2048 \
    -drive if=pflash,format=raw,file=/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw,readonly \
    -drive if=pflash,format=raw,file=fedora-22-aarch64-nvram \
    -device virtio-scsi-device,id=scsi \
    -drive file=fedora-22.img,format=raw,if=none,id=hd0 \
    -device scsi-hd,drive=hd0 \
    -netdev user,id=usernet \
    -device virtio-net-device,netdev=usernet \
    -serial stdio

Leave a comment

Filed under Uncategorized

Actions S900-based 64 bit development board

Never heard of the company or of their 64 bit ARM SoC, but there is a press release here.

3 Comments

Filed under Uncategorized

Fedora 22 virt-builder image

Fedora 22 has been released. And there is a virt-builder cloud image available:

$ virt-builder fedora-22
$ virt-install --import --name test-f22 \
    --ram 2048 --disk path=fedora-22.img,format=raw \
    --os-variant fedora21

3 Comments

Filed under Uncategorized

Fedora 21 chrooted on an aarch64 Nexus 9

fedora

A while back I bought a Nexus 9, mainly because it has a weird processor that emulates a 64 bit ARM (aarch64). Google seem to have abandoned this platform entirely, just 6 months after I got it, so fuck you too Google. Anyway here’s how I installed a Fedora 21 aarch64 chroot on the device, using virt-builder and virt-tar-out and a bunch of unnecessary hassle.

First I ran virt-builder, which takes under a minute to produce a Fedora 21 aarch64 disk image. I then used virt-tar-out to convert all the files in that disk image into a tar file:

$ virt-builder --arch aarch64 fedora-21
$ virt-tar-out -a fedora-21.img / chroot.tar

Copy this file over to the N9, and unpack it. I have rooted my N9, so I can do this as root to preserve all the permissions etc:

# mkdir root
# cd root
# tar -xf /sdcard/Download/chroot.tar
# cd ..

And how can there not be a tar utility in Android?? I had to build a static ‘tar’ for aarch64 using my existing aarch64 server, to run the above command. And and and how can there be no chroot utility either!? I ended up compiling that myself too yada yada.

After all that you can do:

# mount -o bind /dev root/dev
# mount -o bind /proc root/proc
# mount -o bind /sys root/sys
# PATH=/usr/bin:/bin LD_PRELOAD= chroot root /bin/bash

which gives me at least a Fedora 21 shell on Android.

Edit: A few further notes:

  1. When setting up a non-root user account inside the chroot, give it the same UID, GID and groups as the ordinary non-privileged Android user account. In particular it must be in the inet group, else network access is blocked.
  2. You may need to set up /etc/resolv.conf by hand in the chroot.

Leave a comment

Filed under Uncategorized