qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Jim C. Brown" <jbrown106@phreaker.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] vqemu - a simple wrapper
Date: Thu, 17 Jun 2004 16:32:22 -0400	[thread overview]
Message-ID: <20040617203222.GA26832@jbrown.mylinuxbox.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1166 bytes --]

vqemu is a simple shell script that allows you to use a configuration file
called .qemurc with qemu, instead of passing the same command-line paramaters
every time. vqemu looks for .qemurc in the current directory. This is
because I store the different hard disk images (and various other things) for
each OS in a separate directory, so this method makes it easy for me to specify
different configurations for each OS which I run. In any case this is easy
to change (for those of you who are not shell script programmers just change
the line ". .qemurc" to ". $HOME/.qemurc"). The next version of vqemu will
have some way of specifiying a way to use a different config file on the
command line.

Once you have set up .qemurc, you can just run vqemu to load up the emulated
system. You can pass the same paramaters to vqemu that you pass to qemu, so
if an option isn't supported in .qemurc you can just pass that directly
on the command line (for example "vqemu -S").

I attach both vqemu and qemurc.txt (it's a sample .qemurc file with comments
explaining each option).

-- 
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

[-- Attachment #2: vqemu --]
[-- Type: text/plain, Size: 1381 bytes --]

#! /bin/sh
. .qemurc
comline=`which qemu`
if [ -n "$qemu" ]; then
	comline="$qemu"
fi
if [ "$vde" = "on" ]; then
	comline="vdeq $comline"
fi
if [ -n "$boot" ]; then
	comline="$comline -boot $boot"
fi
if [ -n "$megs" ]; then
	comline="$comline -m $megs"
fi
if [ -n "$fda" ]; then
	comline="$comline -fda $fda"
fi
if [ -n "$fdb" ]; then
	comline="$comline -fdb $fdb"
fi
if [ -n "$hda" ]; then
	comline="$comline -hda $hda"
fi
if [ -n "$hdachs" ]; then
	comline="$comline -hdachs $hdachs"
fi
if [ -n "$hdb" ]; then
	comline="$comline -hdb $hdb"
fi
if [ -n "$cdrom" ]; then
	comline="$comline -cdrom $cdrom"
fi
if [ -n "$hdc" ]; then
	comline="$comline -hda $hdc"
fi
if [ -n "$hdd" ]; then
	comline="$comline -hda $hdd"
fi
if [ "$audio" = "on" ]; then
	comline="$comline -enable-audio"
fi
if [ "$pci" = "on" ]; then
	comline="$comline -pci"
fi
if [ -n "$macaddr" ]; then
	comline="$comline -macaddr $macaddr"
fi
if [ "$cirrus" = "on" ]; then
	comline="$comline -cirrusvga"
fi
if [ "$localtime" = "on" ]; then
	comline="$comline -localtime"
fi
if [ "$usernet" = "on" ]; then
	comline="$comline -user-net"
elif [ "$usernet" = "dummy" ]; then
	comline="$comline -dummy-net"
fi
if [ -n "$nics" ]; then
	comline="$comline -nics $nics"
fi
if [ -n "$netscript" ]; then
	comline="$comline -n $netscript"
fi
if [ "$graphic" = "off" ]; then
	comline="$comline -nographic"
fi
exec $comline "$@"


[-- Attachment #3: qemurc.txt --]
[-- Type: text/plain, Size: 4343 bytes --]

# Option "qemu"
# vqemu will run this program in place of qemu.
# Use only if you know what you are doing!
# Default: location of the qemu binary as specified by the which command
# (i.e. the first qemu found in your PATH).
#qemu=/usr/bin/local/qemu

# Option "vde"
# If set to on, vqemu will run qemu using the vdeq wrapper. This requires
# that VDE is installed.
# Default: off
#vde=on

# Option "boot"
# Can be set to a (will boot from the fda file aka floppy),
# c (will boot from hard disk file), or d (generally this means the cdrom).
# Default: c
#boot=c

# Option "megs"
# This will tell qemu how much RAM, in megabytes, the emulated machine will
# have. Must be set to a valid number.
# Default: 32
#megs=32

# Option "fda"
# This is the file that will be used to emulate the first floppy disk.
# This is changable at run-time. See man page for details.
# This must be set if boot is set to a.
# Default: not set
#fda=flpa.img

# Option "fdb"
# This is the file that will be used to emulate the second floppy disk.
# This is changable at run-time. See man page for details.
# Default: not set
#fdb=flpb.img

# Option "hda"
# This is the file that will be used to emulate the master on the primary
# IDE controller.
# This must be set if boot is set to c or left unset.
# Default: not set
#hda=hda.img

# Option "hdachs"
# This may be needed if qemu can not use the hard disk (i.e. its not detecting
# the geometry correctly). Use with caution. Normally not needed as qemu
# is smart.
# Default: auto-detected
#hdachs=200,63,16

# Option "hdb"
# This is the file that will be used to emulate the slave on the primary
# IDE controller.
# Default: not set
#hdb=hdb.img

# Option "cdrom"
# This is the file that will be used to emulate the cdrom, which is the master
# on the secondary IDE controller. This is not compatible with the hdc option.
# This is changable at run-time. See man page for details.
# This must be set if boot is set to d.
# Default: not set
#cdrom=cdrom.iso

# Option "hdc"
# This is the file that will be used to emulate the master on the secondary
# IDE controller. This is not compatible with the cdrom option.
# Note that if this is not set, the default will be to use cdrom emulation
# instead of hard disk emulation, as cdroms are changable while hard disks
# are not.
# Default: not set
#hdc=hdc.img

# Option "hdd"
# This is the file that will be used to emulate the slave on the secondary
# IDE controller.
# Default: not set
#hdd=hdd.img

# Option "audio"
# If set to on, the sound card emulation will be enabled.
# Default: off
#audio=on

# Option "pci"
# If set to on, the PCI layer will be emulated. The network card will become
# a PCI RealTek RT8029 instead of a ISA NE2000. Also you can enable the
# Cirrus VGA driver if this option is on.
# Default: off
#pci=on

# Option "macaddr"
# If set, this is used as the macaddr for the emulated network card.
# This is useful for certain firewalls and other services (e.g. DHCPd
# can assign the same ip address to the same macaddr each time).
# Must be set to the correct format (see qemu man page for details)
# Default: make up a random macaddr on each run
#macaddr=AA:BB:CC:DD:EE:FF

# Option "cirrus"
# If set to on, the Cirrus Video Adaptor emulation will be enabled.
# This requires that pci is also set on.
# Default: off
#cirrus=on

# Option "localtime"
# If set to on, the emulated CMOS will return the time in the local timezone.
# Otherwise it returns the time in UTC.
# Default: off
#localtime=on

# Option "usernet"
# If set to on, the user-net emulation will be enabled. This allows for
# rootless network and internet access. If set to dummy, dummy-net will
# be enabled. This emulates a network card that is not connected to anything.
# Default: off
# Note that qemu might use user-net anyways if it can't enable tuntap networking.
#usernet=on
#usernet=dummy

# Option "nics"
# If set, this is the number of network cards that will be emulated.
# Must be set to a valid number.
# Default: 1
#nics=1

# Option "netscript"
# If set, this is the script to run to set up tuntap networking.
# See qemu man page for details.
# Default: /etc/qemu-ifup
#netscript=setup-tun

# Option "graphic"
# If set to off, the VGA emulation will be disabled. There will be no SDL
# window. All text output will be shown on stdout.
# Default: on
#graphic=off


                 reply	other threads:[~2004-06-17 20:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040617203222.GA26832@jbrown.mylinuxbox.org \
    --to=jbrown106@phreaker.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).