
Show HN: Trivial script to spin up a Debian MIPS|PPC|arm|x86|x64 VM - cellularmitosis
https://gist.github.com/cellularmitosis/54d3cc18e1b128b9286d7ceed3c5bdb7
======
koprulusector
I've worked on something similar using libvirt, kvm, and qemu. Maybe I'll
clean it up and share it here later this week.

The script uses libvirt to automate the process of creating a new kvm VM, and
emulates CPU architecture via qemu (arm, aarch64, ppc, risc, etc).

The VMs run pretty nicely on Debian - including insane boot times and direct
kernel boot.

I'm not sure if MacOS supports kvm or not. A quick google search yields
results to emulate MacOS, though :)

~~~
ckastner
If you do (which would be great), please consider adding it to this list:

[https://wiki.debian.org/SystemBuildTools](https://wiki.debian.org/SystemBuildTools)

------
ckastner
While this is in no doubt very useful, it (as you note) re-uses pre-built
images that are unfortunately ancient (2013).

The real jackpot still remains out there: a tool with which to actually create
those images. Having that would be _awesome_.

I use tool like vmdb2 to generate entirely new Debian VM images in under three
minutes: I have more than a dozen images for my regular Debian development
needs (various distributions, various specializations such as buildd-specific
environments, etc.).

However, unfortunately vmdb2 only supports i386 and amd64 so far.

There are a ton of tools for automatically building Debian systems [1], some
of which can generate bootable images, however they all seem to focus on
i386/amd64.

Fully Automated Installation (FAI) in combination with your gist could be
something that works. FAI is used to generate most of the Debian images for
the cloud providers. So most of the tooling should already be in place.

If you get that to run, I can't say that you will make a lot of people happy,
but you will definitely make a few people very very happy :-)

[1]
[https://wiki.debian.org/SystemBuildTools](https://wiki.debian.org/SystemBuildTools)

------
giomasce
I have a similar thing with weekly updated images (from Debian unstable) and
more supported archs here:
[https://people.debian.org/~gio/dqib/](https://people.debian.org/~gio/dqib/).

~~~
ckastner
This is exactly what I as looking for! I wasn't aware of DQIB. Thanks!

~~~
giomasce
Good! Mind you, they are not high quality images. They're just a raw
mmdebstrap with little configuration, probably not suitable for production
use. I mean them for development. (I specify this because you mentioned tool
for actual production use).

In any case, help yourself!

~~~
ckastner
That's exactly my use case: I use these images for (1) building packages
locally (sbuild has a QEMU bridge via the autopkgtest mode), and (2) for
autopkgtest.

A minimal debootstrap-like installation with only the bare minimum
configuration is ideal for that, it ensures that nothing from my own
environment bleeds into the build/test environment.

I've run into all sorts of issues on non-amd64 platforms, and debugging on
porter boxes is sometimes cumbersome. Most importantly, however, is getting
access to one. For Debian contributors, it's easy, but most upstreams aren't
Debian contributors.

Unless I'm mistaken, I can now at least point them to one of the images you
generate, and they should be able to run it with very little effort.

------
benou
For some usecases you can even use docker for lightweight chroots for ARM,
MIPS, POWER8 etc. At least for me it covers a lot of grounds (eg. developing
for my RPi on my x86 laptop, recompiling a kernel for my ARM-based HTPC etc.)

See [https://benou.fr/www/ben/using-docker-as-chroot-on-
steroids....](https://benou.fr/www/ben/using-docker-as-chroot-on-
steroids.html)

I just checked for Debian 10 for mips64le, ppc64le and arm64v8 targets.

------
cellularmitosis
Hi HN, I found a series of Debian QEMU images and wrote a script around them.
This solves the need of “I need a MIPS box but don’t have time to install
Debian from scratch”.

~~~
cellularmitosis
I should add a note to the script: root passwd is root and a “user” account
exists with passwd “user”

~~~
cellularmitosis
Hello again HN, an update: I added OS detection (apt-get vs brew), and also
set up port-forwarding for port 22. Cheers!

