Skip to content

patatetom/qemu-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 

Repository files navigation

bash qemu helpers

I like QEMU and I like to use it directly from the CLI to run tests with virtual machines : these helpers save me typing time.

download .qemu-helpers.rc and source it after checking in your current bash shell or in your ~/.bashrc.

qemu

alias

quick call to qemu-system-x86_64 with a few default parameters that can naturally (for the most part) be overridden by the command line. -serial mon:stdio avoids an unfortunate Ctrl-C.

qemu function and qemu alias cannot coexist. this latter is commented/deactivated in favor of the function.

function

this helper executes qemu-system-x86_64 with the parameters stored in the qemu.cfg configuration file (if present and executable) and the parameters passed on the command line (which supplement or overwrite those previously defined in the configuration file or in the function). symbolic link can be used for qemu.cfg configuration file (eg. multiple settings). chmod +x qemu.cfg to activate the configuration and chmod -x qemu.cfg to deactivate it.

qemu function and qemu alias cannot coexist.

qemu-img

qemu-img create

this helper allows you to create a new image (qcow2 if not specified) based on a previous one, whose format will be automatically detected. it stops if the base image supplied is not read-only.

qemu-img create -b previous next will run /usr/bin/qemu-img create -b previous -F qcow2 -f qcow2 next if previous base is a qcow2 file (magic string QFI\xfb) and /usr/bin/qemu-img create -b previous -F raw -f qcow2 next otherwise.

qemu-img tree

this helper displays base images (eg. dependencies) in tree form, highlighting those that are not read-only.

qemu-usbhost

this helper makes it easy to find the usb port where a smartphone is plugged in, so that it can be fully transferred to the virtual machine.

Releases

No releases published

Packages

No packages published

Languages