2022-10-18 17:20:26 +00:00
The intent of this page is to provide simple instructions to perform an autoinstall in a VM on your machine on s390x.
2022-10-19 10:00:57 +00:00
This page is just a slightly adapted page of [the autoinstall quickstart page ](autoinstall-quickstart.md ) mapped to s390x.
2022-10-18 17:20:26 +00:00
## Download an ISO
2022-10-24 16:51:40 +00:00
At the time of writing (just after the kinetic release), the best place to go is here:
< https: / / cdimage . ubuntu . com / ubuntu / releases / 22 . 10 / release / >
2022-10-18 17:20:26 +00:00
2023-10-18 20:17:28 +00:00
```bash
wget https://cdimage.ubuntu.com/ubuntu/releases/22.10/release/ubuntu-22.10-live-server-s390x.iso -P ~/Downloads
```
2022-10-18 17:20:26 +00:00
## Mount the ISO
2023-10-18 20:17:28 +00:00
```bash
mkdir -p ~/iso
sudo mount -r ~/Downloads/ubuntu-22.10-live-server-s390x.iso ~/iso
```
2022-10-18 17:20:26 +00:00
## Write your autoinstall config
2023-10-18 20:17:28 +00:00
This means creating a cloud-init #cloud -config file as follows:
2022-10-18 17:20:26 +00:00
2023-10-18 20:17:28 +00:00
```bash
mkdir -p ~/www
2022-10-18 17:20:26 +00:00
cd ~/www
cat > user-data < < 'EOF'
#cloud-config
autoinstall:
version: 1
identity:
hostname: ubuntu-server
password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
username: ubuntu
EOF
2023-10-18 20:17:28 +00:00
touch meta-data
```
2022-10-18 17:20:26 +00:00
The crypted password is just "ubuntu".
2023-10-18 20:17:28 +00:00
## Serve the cloud-init config over HTTP
2022-10-18 17:20:26 +00:00
2023-10-18 20:17:28 +00:00
Leave this running in a new terminal window:
2022-10-18 17:20:26 +00:00
2023-10-18 20:17:28 +00:00
```bash
cd ~/www
python3 -m http.server 3003
```
2022-10-18 17:20:26 +00:00
## Create a target disk
Proceed with a second terminal window:
2023-10-18 20:17:28 +00:00
```bash
sudo apt install qemu-utils
```
2022-10-18 17:20:26 +00:00
2023-10-18 20:17:28 +00:00
```bash
qemu-img create -f qcow2 disk-image.qcow2 10G
2022-10-18 17:20:26 +00:00
Formatting 'disk-image.qcow2', fmt=qcow2 size=10737418240 cluster_size=65536 lazy_refcounts=off refcount_bits=16
qemu-img info disk-image.qcow2
image: disk-image.qcow2
file format: qcow2
virtual size: 10 GiB (10737418240 bytes)
disk size: 196 KiB
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
2023-10-18 20:17:28 +00:00
corrupt: false
```
2022-10-18 17:20:26 +00:00
## Run the install!
2023-10-18 20:17:28 +00:00
```bash
sudo apt install qemu-kvm
```
You may need to add the default user to the `kvm` group:
```bash
sudo usermod -a -G kvm ubuntu
```
2022-10-18 17:20:26 +00:00
2023-10-18 20:17:28 +00:00
> **Note**:
> You will need to re-login to make the changes take effect.
2022-10-18 17:20:26 +00:00
2023-10-18 20:17:28 +00:00
```bash
kvm -no-reboot -name auto-inst-test -nographic -m 2048 \
2022-10-18 17:20:26 +00:00
-drive file=disk-image.qcow2,format=qcow2,cache=none,if=virtio \
2022-10-24 16:51:40 +00:00
-cdrom ~/Downloads/ubuntu-22.10-live-server-s390x.iso \
2022-10-18 17:20:26 +00:00
-kernel ~/iso/boot/kernel.ubuntu \
-initrd ~/iso/boot/initrd.ubuntu \
2023-10-18 20:17:28 +00:00
-append 'autoinstall ds=nocloud-net;s=http://_gateway:3003/ console=ttysclp0'
```
2022-10-18 17:20:26 +00:00
2023-10-18 20:17:28 +00:00
This will boot, download the config from the server set up in the previous step and run the install. The installer reboots at the end but the `-no-reboot` flag to `kvm` means that `kvm` will exit when this happens. It should take about 5 minutes.
2022-10-18 17:20:26 +00:00
## Boot the installed system
2023-10-18 20:17:28 +00:00
```bash
kvm -no-reboot -name auto-inst-test -nographic -m 2048 \
-drive file=disk-image.qcow2,format=qcow2,cache=none,if=virtio
```
2022-10-18 17:20:26 +00:00
2023-10-18 20:17:28 +00:00
This will boot into the freshly installed system and you should be able to log in as `ubuntu` /`ubuntu`.