1

I am having problem logging in into a Fedora 22 virtual machine, based on a cloud F22 image. Without touching the downloaded image I could boot just not login.

I downloaded

https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/i386/Images/Fedora-Cloud-Base-22-20150521.i386.raw.xz

and, following

https://lists.fedoraproject.org/pipermail/users/2013-November/442288.html

I issued

$ virt-sysprep -a Fedora-Cloud-Base-22-20150521.i386.raw  --root-password password:XXXX

on a CentOS box running

$ virt-sysprep --version
virt-sysprep 1.20.11

I created a vmdk disk image with

D:\iso>vboxmanage convertdd Fedora-Cloud-Base-22-20150521.i386.raw d:\VirtualBoxVirtualMachines\Fedora22\Fedora22-password.vmdk --format vmdk
Converting from raw image file="Fedora-Cloud-Base-22-20150521.i386.raw" to file="d:\VirtualBoxVirtualMachines\Fedora22\Fedora22-password.vmdk"...
Creating dynamic image with size 3221225472 bytes (3072MB)...

With the new Fedora22-password.vmdk I could not boot on VirtualBox, it said Boot error.

I am not sure what went wrong, either the copying to the CentOS box and back suffered some error or the virt-sysprep command had a bug. How can I check on the command line whether a raw image is bootable?

And, how could I set the password for this Fedora image, either this way or some other method?

2 Answers 2

1

It seems that

--enable password

is essential at

https://lists.fedoraproject.org/pipermail/users/2013-November/442288.html

virt-sysprep -a foo.qcow2 --enable password --root-password password:123456

Otherwise virt-sysprep overwrites many other things in the raw image, corrupting it so you cannot boot from it.

Omitting --enable password resulted in

$ virt-sysprep -a Fedora-Cloud-Base-22-20150521.i386.raw  --root-password password:1234
Examining the guest ...
Performing "yum-uuid" ...
Performing "utmp" ...
Performing "udev-persistent-net" ...
Performing "tmp-files" ...
Performing "sssd-db-log" ...
Performing "ssh-userdir" ...
Performing "ssh-hostkeys" ...
Performing "smolt-uuid" ...
Performing "script" ...
Performing "samba-db-log" ...
...

but using it the first time it was not obvious being bad.

On proper invocation it touches only the password part of the image:

$ virt-sysprep -a Fedora-Cloud-22-password.i386.raw --enable password --root-password password:XXXX
Examining the guest ...
Performing "password" ...

And I can now log in to the virtual machine.

1

The Fedora Cloud image is really meant to be run in a cloud environment, with a metadata service providing configuration data (including ssh keys for the default fedora account). If you want to run cloud image locally, we have a utility testcloud, which "spoofs" all this, so you can just do

 testcloud instance create <name of instance> -u <url for qcow2 image>

Alternately, you may want to grab one of the Vagrant boxes we build, which follow the normal vagrant conventions user and password of vagrant / vagrant. (This even comes in a VirtualBox variant.)

3
  • thanks, does this run on a Windows host?
    – Gergely
    Sep 14, 2015 at 19:43
  • 1
    @Gergely Good question — testcloud is in Python, so it might, but I don't know if anyone has actually tested it. It'd be pretty cool/useful if it does, though, and I'm sure any necessary patches (or simply bug reports) would be appreciated.
    – mattdm
    Sep 14, 2015 at 19:45
  • The Vagrant boxes, of course, will work in Windows.
    – mattdm
    Sep 14, 2015 at 19:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .