作者:张华 发表于:2024-07-20
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明(http://blog.csdn.net/quqi99)
try ubuntu core on qemu
#ovmf is to ensure compatibility with the required UEFI features in ubuntu core
sudo apt install qemu-kvm ovmf
kvm-ok
#swtpm is to provide a TPM emulator
sudo snap install --edge test-snapd-swtpm
#Download ubuntu core - https://ubuntu.com/core/docs/supported-platforms
wget https://cdimage.ubuntu.com/ubuntu-core/24/stable/current/ubuntu-core-24-amd64.img.xz
xz -d ubuntu-core-24-amd64.img.xz
#With TPM emulation and full disk encryption
sudo qemu-system-x86_64 -enable-kvm -smp 1 -m 2048 -machine q35 -cpu host -global ICH9-LPC.disable_s3=1 \
-net nic,model=virtio -net user,hostfwd=tcp::8022-:22,hostfwd=tcp::8090-:80 \
-drive file=/usr/share/OVMF/OVMF_CODE.secboot.fd,if=pflash,format=raw,unit=0,readonly=on \
-drive file=/usr/share/OVMF/OVMF_VARS.ms.fd,if=pflash,format=raw,unit=1 \
-drive "file=/images/kvm/ubuntu-core-24-amd64.img",if=none,format=raw,id=disk1 \
-device virtio-blk-pci,drive=disk1,bootindex=1 -serial mon:stdio
#https://login.ubuntu.com and https://login.ubuntu.com/ssh-keys
ssh <your-name>@localhost -p 8022
try ubuntu core on raspberry pi
#download image from https://ubuntu.com/core/docs/supported-platforms , eg: ubuntu-core-24-arm64+raspi.img.xz
xz -d ubuntu-core-24-arm64+raspi.img.xz
sudo dd if=ubuntu-core-24-arm64+raspi.img of=/dev/sdb status=progress; sync
try ubuntu core on x64 computer
#dd to usb or disk
sudo dd if=/images/kvm/ubuntu-core-24-amd64.img of=/dev/sdb status=progress; sync
Reference
[1] https://ubuntu.com/core/docs/testing-with-qemu