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.
Tag Archives: libguestfs
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
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:
- 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
inetgroup, else network access is blocked.
- You may need to set up
/etc/resolv.confby hand in the chroot.
Slowly, of course.
$ cat localenv export SUPERMIN=/home/rjones/d/supermin-mipsel/src/supermin export LIBGUESTFS_HV=/home/rjones/d/qemu-mipsel/mipsel-softmmu/qemu-system-mipsel export SUPERMIN_KERNEL=/home/rjones/d/libguestfs-mipsel/kernel/boot/vmlinux-3.16.0-0.bpo.4-4kc-malta export SUPERMIN_KERNEL_VERSION=3.16.0-0.bpo.4-4kc-malta export SUPERMIN_MODULES=/home/rjones/d/libguestfs-mipsel/kernel/lib/modules/3.16.0-0.bpo.4-4kc-malta/
Debian 8 was released a couple of days ago, and you can now install it through virt-builder.
--notes to read the release notes:
$ virt-builder debian-8 --notes
To build an image:
$ virt-builder debian-8 \ --firstboot-command "dpkg-reconfigure openssh-server"
To boot it under libvirt:
$ virt-install --import \ --name debian-8 --ram 2048 \ --disk path=debian-8.img,format=raw --os-variant=debianwheezy
(At some point
--os-variant=debianjessie will work, but virt-install doesn’t support it yet)
Update: This is how I ended up running Debian 8:
$ virt-builder debian-8 \ --size=30G \ --root-password PASSWORD \ --edit '/etc/apt/sources.list: s/wheezy/jessie/g' \ --run-command ' apt-get -y install debian-keyring debian-archive-keyring apt-key update ' \ --install emacs,nfs-common,sudo \ --edit '/etc/ssh/sshd_config: s/^#PermitEmptyPasswords no/PermitEmptyPasswords yes/' \ --firstboot FIRSTBOOT.sh --run-command 'update-rc.d virt-sysprep-firstboot defaults' \ --run-command 'killall dbus-daemon cgmanager ||:'
- You can now download RHEL 7.2 preview packages for virt-v2v
- Windows 8, 8.1, 2012 and 2012R2 are supported: I finally worked out the complicated series of Windows registry edits needed to make this work.
- Guests with sound cards are now supported.
- Guests with VNC display port information are now supported (thanks Pino Toscano).
- There is now a test harness for virt-v2v.
- Integration with oVirt and RHEV-M.