Taking advantage of cloud images

freebsd

see guest-freebsd-cloud

NetBSD

guest=netbsd9
    mkdir /root/guests/$guest/
    cd /root/guests/$guest/
cat > network.conf <<EOF
sets=/data/kernels/netbsd9
kernel=/data/kernels/netbsd9
pubkey="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMNWddNzcz/4w/B5fWTuMDO1jGyuWJhCn0j0WAD1/Pcf elge@extensa"
netif=xennet0
host=france1
cidr=10.3.3.x/24
gw=10.3.3.x
dns="62.210.16.6 62.210.16.7"
EOF
../netbsd.install.bash pv france1

eventually add another network interface if you need to

vi $guest

mac=...

ready to go

xl create $guest -c

Ubuntu

guest=focal
mkdir /root/guests/$guest/
cd /root/guests/$guest/
tar xSzf /data/kernels/focal/focal-server-cloudimg-amd64.tar.gz
mv focal-server-cloudimg-amd64.img focal.ext4
mkdir lala/
mount focal.ext4 lala/
tar xzf /data/kernels/5.2.21.lightUreiser4.tar.gz -C lala/lib/modules/
echo tmem >> lala/etc/modules
echo $guest > lala/etc/hostname
vi lala/etc/fstab

/dev/xvda1      /        ext4   defaults        0 1

chroot lala/
passwd
ssh-keygen -A
systemctl disable multipathd.service
systemctl disable systemd-timesyncd.service
^D

vi lala/etc/netplan/nethence.yaml

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
      addresses:
       - 10.3.3.x/24
      gateway4: 10.3.3.x
      nameservers:
    search: [nethence.com]
    addresses: [62.210.16.6, 62.210.16.7]

skeleton and beware vdisk is against /data1/ here

vi focal

kernel = "/data/kernels/vmlinuz"
root = "/dev/xvda1 ro console=hvc0 net.ifnames=0 biosdevname=0 mitigations=off"
memory = 7168
name = "focal"
vcpus = 3
maxvcpus = 8
disk = ['tap:tapdisk:aio:/data1/guests/focal/focal.ext4,xvda1,w']
vif = [ 'bridge=br0, vifname=focal.0' ]
type = "pvh"

xl create $guest -c

finish-up

apt -y purge snapd
apt -y purge multipath-tools
apt -y purge linux-headers-virtual linux-image-virtual
dpkg -l | grep linux
apt purge linux-...
rm -rf /lib/modules/5.4.0-45-generic/
apt -y purge grub-pc
apt -y purge open-vm-tools
apt autoremove --purge
rm -rf /etc/default/grub.d/

ping -c1 opendns.com
apt update
apt full-upgrade
apt install net-tools

history -c

and from the XEN host

xl shu $guest

HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun