Primer // XEN guests install methods

No need to use the ISO nor even the official kernel from a distribution, to start a guest installer. All you need is really its installer RAMDISK. Other methods such as debootstrap, virt-install, rinse, or xen-create-image^create are also relevant.

Bootstraping

dist=bionic

mkdir lala/
mount ... lala/
debootstrap --arch=amd64 $dist lala/ http://ru.archive.ubuntu.com/ubuntu/

cat > lala/etc/fstab <<-EOF
proc /proc proc defaults 0 0
/dev/xvda1 / ext4 defaults 0 1
EOF

mv /etc/apt/sources.list /etc/apt/sources.list.dist
cat > /etc/apt/sources.list <<-EOF
deb http://ru.archive.ubuntu.com/ubuntu $dist main restricted universe
deb http://ru.archive.ubuntu.com/ubuntu $dist-updates main restricted universe
deb http://ru.archive.ubuntu.com/ubuntu $dist-security main restricted universe
#multiverse
#$dist-backports
EOF

XEN/PV guest config

cat > $dist <<-EOF
kernel = "/data/kernels/vmlinuz"
root = "/dev/xvda1 ro console=hvc0 netcfg/do_not_use_netplan=true ipv6.disable=1"
memory = 8192
name = "$dist"
vcpus = 16
maxvcpus = 16
disk = ['tap:tapdisk:aio:/data/guests/$dist/$dist.ext4,xvda1,w']
#disk = ['tap:tapdisk:aio:/data/guests/$dist/$dist.reiser4,xvda1,w']
vif = [ 'bridge=xenbr0, vifname=$dist.0' ]
EOF

Ready to go

xl create $dist -c

login and check that everything is fine,

lsmod | grep tmem
free -m
ifconfig
ping opendns.com
poweroff

unset dist

XEN/HVM guest config

specific to HVM,

#4.9
builder = "hvm"

#4.10+
#type = "hvm"

sdl = 1

#vnc = 0
#vnclisten = "0.0.0.0"
#vncpasswd = "PASSWORD"

#spice = 1
#spiceport = XXXX
#spicepasswd = "PASSWORD"

#nographics=1
#serial='pty'

Nethence | Doc | Pub | Lab | Pbraun | SNE Russia | xhtml