Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The "–visibility public" flag is used to indicate that all projects should have access to this image, and the upload would then require admin credentials. In the case of an image upload which should only be accessible to the project uploading it, that flag can be omitted.

Change image-init images

Required packages for ubuntu, other OS might have different names. The procedure is tested with raw and qcow2 images.

  • qemu-utils
  • guestfish
  • libguestfs-tools
  • working sudo for your user

Verify that the cloud-init image is ok.

Code Block
titleqemu
:~$  qemu-img check <image name>
No errors were found on the image.
14510/36032 = 40.27% allocated, 98.23% fragmented, 98.04% compressed clusters
Image end offset: 289210368

Manipulate the image with guestfish

Code Block
titleguestfish
# Mounting the filesystem
:~$ sudo guestfish

Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs> add ubuntu-16.04-server-cloudimg-amd64-disk1-bjarne.raw
><fs> run
><fs> list-filesystems 
/dev/sda1: ext4
><fs> mount /dev/sda1 /

# Editing a file
><fs> vi /etc/fstab

#Copying in a file from outside the image
><fs> copy-in <file outside the image> <pat to where to put it>

# Commiting and exiting guestfish. Exit does both
><fs> exit

 

Change existing images

 

Creating Windows Images

...