When using capture=True together with subprocess.run, interactive
session will not work, as all the output will be captured. Perfectly
well seen with `boxpy ssh`. This commit will fix this issue.
Note, there is something weird with those images, as the will segfault
on the first run (I've checked that with latest Debian 11 images, maybe
it will change in the future), so there is forced reboot after certain
amount of time as a workaround.
It might have impact on how operating system inside VM is treated by
VirtualBox, so let's stick with proper distro for every OS. As an
outcome, it turns out, that for graphical side of the vm, for Linux OS
the vmsvga driver is recommended, as a little more amount of vram.
Two new commandline options are added: image and default-user. When
image parameter has been add there are implications that:
- default-user is also provided by commandline - regardless it is
already present in yaml config
- distro parameter is ignored
- custom username, which might be provided by yaml file will become
default-user if absent.
All of that is the consequence, that by providing custom qcow2 image
there is no easy way to determine what operating system is passed by,
therefore it is purely declarative way of creating VM with such image.
During cloud init user might want to change default user from the
distribution to something else. It will not be possible to ssh to such
machine using boxpy ssh command - only using ssh directly with the
correct user name would be possible. In this change there is added
possibility for setting username in boxpy_data section with desired
value to be used in ssh command.
In case of Centos, there is a need to get the checksum file first to
figure out the correct image filename, during that process checksum file
was left alone in the current directory. Place it in the temp dir in the
first place and than remove after we know the right image filename.
Some systems have to have a strict control, even in system state
information. Prefixed with "sudo" to command to gather information how
cloud init is doing.
There were very similar methods for downloading/proceeding with
checksum for both Ubuntu and Fedora classes. Extracted those two into
methods in base class.