项目作者: pawel-slowik

项目描述 :
A QEMU wrapper for performing automated Debian installations in QEMU virtual machines.
高级语言: Python
项目地址: git://github.com/pawel-slowik/d-i-preseed-qemu.git
创建时间: 2019-08-05T16:22:42Z
项目社区:https://github.com/pawel-slowik/d-i-preseed-qemu

开源协议:MIT License

下载


A QEMU wrapper for performing automated Debian installations in QEMU
virtual machines.

Automation is based on Debian installer preseeding.

Supports the i386, amd64 and arm64 architectures.

Installation

Clone this repository and run the script from there.

Requirements

  • Python 3.x
  • QEMU
  • isoinfo, dd, fdisk, sfdisk, mkfs.ext2, debugfs

Install all the requirements on Debian 10 / buster with:

  1. apt-get install python3 qemu-kvm qemu-system-arm qemu-utils genisoimage coreutils fdisk e2fsprogs

Usage

  1. ~/path/preseed_install.py -i debian-10.0.0-amd64-netinst.iso -u http://server/preseed.cfg -o debian-10.qcow2
  2. ~/path/preseed_install.py --help

By default the installation runs without any keyboard / display IO (since it’s
meant to be fully automated). If you want to see the installer working use the
-d VNC_DISPLAY option, e.g. -d :1. You can then connect to the VM with a
VNC client:

  1. vncviewer :1

You can use the Python built in HTTP server for serving preseed configuration
files:

  1. python3 -m http.server --bind 10.0.10.1 8080

and then refer to a file with -u http://10.0.10.1:8080/preseed.cfg.

ARM notes

The arm64 installer randomly fails at one of the first steps, e.g. at Detect
and mount CD-ROM
or at Access software for blind person using a braille
display
. I haven’t found a solution yet, for now you’ll need to keep retrying.

I couldn’t find any way to install a working bootloader for ARM from the Debian
installer. Therefore this script will attempt to extract the kernel and initrd
files after the installation is complete, so that you can use them to boot the
VM with QEMU -kernel and -initrd parameters. The extracted files are saved
with .kernel and .initrd extensions. E.g. for -o debian-10-arm64.qcow2
the extracted files are named debian-10-arm64.kernel and
debian-10-arm64.initrd.

Extracting the kernel and initrd files currently only works for a DOS partition
table and an ext2 / ext3 / ext4 filesystem.

Acknowledgements