oxidecomputer / helios-engvm

Tools for creating and using Helios images on i86pc (classic PC) physical and virtual machines
Mozilla Public License 2.0
30 stars 1 forks source link

failed to create vm using defaults #17

Closed nathanaelhuffman closed 1 year ago

nathanaelhuffman commented 1 year ago

Here's the output from the script:

helios-engvm git:(main) ./create.sh defaults
+ set -o pipefail
+ set -o errexit
+++ dirname ./create.sh
++ cd .
++ pwd
+ TOP=/home/nhuffman/oxide/helios-engvm
++ uname
+ [[ Linux == Darwin ]]
+ . /home/nhuffman/oxide/helios-engvm/config/defaults.sh
++ VM=helios
++ POOL=default
++ INPUT_IMAGE=helios-qemu-ttya-full.raw
++ SIZE=30G
++ VCPU=2
++ MEM=2097152
+ [[ -n defaults ]]
+ . /home/nhuffman/oxide/helios-engvm/config/defaults.sh
++ VM=helios
++ POOL=default
++ INPUT_IMAGE=helios-qemu-ttya-full.raw
++ SIZE=30G
++ VCPU=2
++ MEM=2097152
+ [[ -z helios ]]
+ [[ -z default ]]
+ [[ -z 2 ]]
+ [[ -z 2097152 ]]
+ [[ -z 30G ]]
+ [[ -z helios-qemu-ttya-full.raw ]]
+ QEMU=/usr/bin/qemu-system-x86_64
+ [[ ! -x /usr/bin/qemu-system-x86_64 ]]
+ VOL_QCOW2=helios.qcow2
+ VOL_METADATA=helios-metadata.cpio
+ virsh pool-info default
+ virsh desc helios
error: failed to get domain 'helios'

+ virsh vol-info --pool default helios.qcow2
error: failed to get vol 'helios.qcow2'
error: Storage volume not found: no storage vol with matching path 'helios.qcow2'

+ virsh vol-info --pool default helios-metadata.cpio
error: failed to get vol 'helios-metadata.cpio'
error: Storage volume not found: no storage vol with matching path 'helios-metadata.cpio'

+ cd /home/nhuffman/oxide/helios-engvm
+ rm -rf /home/nhuffman/oxide/helios-engvm/tmp
+ mkdir /home/nhuffman/oxide/helios-engvm/tmp
+ mkdir -p /home/nhuffman/oxide/helios-engvm/input/cpio
+ [[ ! -f /home/nhuffman/oxide/helios-engvm/input/cpio/authorized_keys ]]
+ [[ ! -f /home/nhuffman/.ssh/authorized_keys ]]
+ echo 'you have no /home/nhuffman/.ssh/authorized_keys file'
you have no /home/nhuffman/.ssh/authorized_keys file
+ echo

+ echo 'populate /home/nhuffman/oxide/helios-engvm/input/cpio/authorized_keys and run again'
populate /home/nhuffman/oxide/helios-engvm/input/cpio/authorized_keys and run again
+ echo

+ exit 1

virt-manager is installed:

➜  helios-engvm git:(main) sudo apt install virt-manager
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
virt-manager is already the newest version (1:4.0.0-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded

groups are set:

➜  helios-engvm git:(main) groups
libvirt adm sudo plugdev lpadmin docker nhuffman

Running on pop_os 22.04 an ubuntu derivative:

  helios-engvm git:(main) lsb_release -a
LSB Version:    core-11.1.0ubuntu4-noarch:printing-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch
Distributor ID: Pop
Description:    Pop!_OS 22.04 LTS
Release:    22.04
Codename:   jammy
nathanaelhuffman commented 1 year ago

so in reality this is a dupe of #9. The errors "error: failed to get domain 'helios'" aren't really since they're just the output of a machine that hasn't had this configured 1x yet. cat'ing the .pub key into a newly created authorized_keys file makes the process go as expected.