summaryrefslogtreecommitdiff
path: root/usr.sbin/vmctl
AgeCommit message (Collapse)Author
2019-03-01Fix previous extra arguments commitkn
I blatantly missed the argc/argv adjustments after getopt(3), resulting in valid commands like `vmctl create a -s 1G' to fail. Noticed by ajacoutot the hard way. OK ajacoutot jca
2019-03-01Print usage on extra create, start and stop argumentskn
OK mlarkin
2019-01-18disable vmd/vmctl for i386pd
Next commit will delete vmm(4) for i386. Reasons to delete i386 vmm: - Been broken for a while, almost no one complained. - Had been falling out of sync from amd64 while it worked. - If your machine has vmx, you most probably can run amd64, so why not run that? ok mlarkin@ deraadt@
2018-12-18show log/reset/stop as single commands, like usage() currently does;Jason McIntyre
ok mlarkin claudio
2018-12-14sync usage(); also, stop enclosing arg names in quotes, since it wasJason McIntyre
applied inconsistently, and applied consistently would make it look like spaghetti; ok mlarkin
2018-12-13various minor tweaks; ok mlarkinJason McIntyre
2018-12-11Extend vmctl start -B argument to work for disk, cdrom and net.Claudio Jeker
Currently SeaBIOS will respect disk and cdrom and our kernel will understand net. OK ccardenas@, reyk@, mlarkin@
2018-12-07zap trailing whitespaceanton
2018-12-06Add a new argument -B device to vmctl start. It allows to set the boot device.Claudio Jeker
At the moment only 'net' is supported and all other values are silently ignored. This allows to kick of an OpenBSD autoinstall by using: vmctl start "installer" -Lc -B net -b bsd.rd -d disk.img OK ccardenas@
2018-12-04Add 'vmctl wait <VM>' a command that waits until the specified VM isClaudio Jeker
stopped/terminates. Useful in scripts when waiting until a vm has finished its work. Ok ccardenas@, reyk@
2018-11-26Move the {qcow2,raw} create functions from vmctl into vmd/vio{qcow2,raw}.cReyk Floeter
This way they are in the appropriate place and code can be shared with vmd. Ok ori@ mlarkin@ ccardenas@
2018-11-20DNS goes over both udp and tcp, so reflect that in example pf.conf line;Otto Moerbeek
ok reyk@
2018-10-20remove unneccessary macros;Jason McIntyre
2018-10-19Add support to create and convert disk images from existing imagesReyk Floeter
The -i option to vmctl create (eg. vmctl create output.qcow2 -i input.img) lets you create a new image from an input file and convert it if it is a different format. This allows to convert qcow2 images from raw images, raw from qcow2, or even qcow2 from qcow2 and raw from raw to re-optimize the disk. This re-uses Ori's vioqcow2.c from vmd by reaching into it and compiling it in. The API has been adjust to be used from both vmctl and vmd accordingly. OK mlarkin@
2018-10-08Add support for qcow2 base images (external snapshots).Reyk Floeter
This works is from Ori Bernstein, committing on his behalf: Add support to vmd for external snapshots. That is, snapshots that are derived from a base image. Data lookups start in the derived image, and if the derived image does not contain some data, the search proceeds ot the base image. Multiple derived images may exist off of a single base image. A limitation of this format is that modifying the base image will corrupt the derived image. This change also adds support for creating disk derived disk images to vmctl. To use it: vmctl create derived.qcow2 -s 16G -b base.qcow2 From Ori Bernstein OK mlarkin@ reyk@
2018-10-05Setting getopt optreset to 1 needs an additional reset of optind to 1.Reyk Floeter
OK millert@
2018-10-02Fix potential rounding errors when calculating the qcow2 l1 and ref tables sizesReyk Floeter
OK ccardenas@ mlarkin@
2018-10-01Try to derive the qcow2 file format from an image file automatically.Reyk Floeter
This makes the "-d qcow2:" and "format qcow" arguments optional as vmctl and vmd will read the magic bytes at the beginning of a file to guess if it is a raw or a qcow image file. The "vmctl create" command has been changed by removing the -f qcow2 option and replacing it with the same syntax as -d: "vmctl create qcow2:foo.img". In a slightly ununixy but intended way, the create command now also considers the file extension for the format as "vmctl create foo.qcow2" creates a qcow2 disk and not a raw image file. Ok mlarkin@ (and ccardenas@ on an earlier version of the diff)
2018-09-27Add vmctl stop -a [-fw] option to stop or terminate all running VMs.Reyk Floeter
This is also be used to simplify the vmd rc stop script. OK mlarkin@ ccardenas@
2018-09-21Add explanations about vmctl send commandsolene
ok jmc@ jca@ mlarkin@ mdoc tip from bentley@
2018-09-16Use user_from_uid(3) and group_from_gid(3) in a few more placesTodd C. Miller
that do repeated lookups. OK tb@
2018-09-13Add initial set of unveil's to vmctl.ccardenas
Was in snaps for a while. Ok mlarkin@ and reyk@
2018-09-11Add ability to create qcow2 disk.ccardenas
vmctl create now takes an optional disk format parameter: raw or qcow2. If format is omitted, raw is used. Many thanks to Ori Bernstein.
2018-09-09tweak previous;Jason McIntyre
2018-09-09Add initial qcow2 image support.ccardenas
Users are able to declare disk images as 'raw' or 'qcow2' using either vmctl and vm.conf. The default disk image format is 'raw' if not specified. Examples of using disk format: vmctl start bsd -Lc -r cd64.iso -d qcow2:current.qc2 or vmctl start bsd -Lc -r cd64.iso -d raw:current.raw is equivalent to vmctl start bsd -Lc -r cd64.iso -d current.raw in vm.conf vm "current" { disable memory 2G disk "/home/user/vmm/current.qc2" format "qcow2" interface { switch "external" } } or vm "current" { disable memory 2G disk "/home/user/vmm/current.raw" format "raw" interface { switch "external" } } is equivlanet to vm "current" { disable memory 2G disk "/home/user/vmm/current.raw" interface { switch "external" } } Tested by many. Big Thanks to Ori Bernstein.
2018-08-23Allow to boot CDROM-only VMs.Reyk Floeter
Pointed out by Jon Williams OK mlarkin@ kn@ ccardenas@
2018-07-29add missing markup and some minor tweaks; ok jmc@anton
2018-07-12The vmctl start -I option was changed to -t.Reyk Floeter
I committed the manpage but accidentally forgot the main.c part. OK ccardenas@
2018-07-12Allow to use configured/running VMs as templates for other VM instances.Reyk Floeter
This introduces new grammar and the -t optional in vmctl start. (For now, only root can create VM instances; but it is planned to allow users to create their own VMs based on permissions and quota.) OK ccardenas@ mlarkin@ jmc@
2018-07-11check string lengths in vm_startReyk Floeter
2018-07-11remove useless macro;Jason McIntyre
2018-07-11Add -w option to vmctl stop to wait for completion of VM termination.Reyk Floeter
Use it in /etc/rc.d/vmd accordingly. OK sthen@
2018-07-11Add -f option to vmctl stop to forcefully kill a VM.Reyk Floeter
This also fixes a bug in vmm_sighdlr where it might have missed forwarding the TERMINATE_EVENT to the vmd parent after a VM child died, leading to an abandoned VM in the vmd parent process. OK ccardenas@ mlarkin@ benno@ kn@
2018-07-04When a VM stop request fails, set errno prior to calling warn() in order toanton
display the correct error message. This is a pattern found elsewhere in vmctl. With input from deraadt@ and encouraged by mlarkin@
2018-06-19knfReyk Floeter
2018-03-14block two VMs from using the same disk image file at the same time.Mike Larkin
Also changes an error message in vmctl to reflect same.
2018-03-14knfMike Larkin
2018-02-26vmctl: clarify console error messageccardenas
Clear up ambiguous error message when attaching to a console fails as the vm id is not guaranteed to be populated. ok mlarkin@
2018-02-24sort;Jason McIntyre
2018-02-24add an alias for vmctl show, matches finger memory and the rest of thePeter Hessler
*ctl programs OK mlarkin@ benno@ deraadt@
2018-01-03pretty up the "start" command;Jason McIntyre
2018-01-03Add initial CD-ROM support to VMD via vioscsi.ccardenas
* Adds 'cdrom' keyword to vm.conf(5) and '-r' to vmctl(8) * Support various sized ISOs (Limitation of 4G ISOs on Linux guests) * Known working guests: OpenBSD (primary), Alpine Linux (primary), CentOS 6 (secondary), Ubuntu 17.10 (secondary). NOTE: Secondary indicates some issue(s) preventing full/reliable functionality outside the scope of the vioscsi work. * If the attached disks are non-bootable (i.e. empty), SeaBIOS (vmd's default BIOS) will boot from CD-ROM. ok mlarkin@, jca@
2017-11-05Add minimal DHCP support to vmd's built-in DHCP/BOOTP server.Reyk Floeter
This fixes "local interface" mode with the udhcpc client. udhcpc, a DHCP client that is used by busybox and many embedded Linux distributions, does not support BOOTP which is the predecessor and a valid subset of DHCP. OK mlarkin@, Carlos Cardenas
2017-10-07Prefer memset() over bzero()Philip Guenther
ok deraadt@ mlarkin@
2017-09-08better VM termination handling.Mike Larkin
diff provided by Carlos Cardenas, thanks
2017-09-08vmctl: style cleanup - spaces vs tabs.Mike Larkin
Noticed by Carlos Cardenas
2017-09-05Detail how VM guests acquire a nameserver for local interfaces.Edd Barrett
OK mlarkin@, krw@. Thanks!
2017-09-01vmctl: -L option clarification in man pageMike Larkin
2017-08-31vmctl: change a feedback message displayed to the user from "terminatedMike Larkin
vm X" to "sent request to terminate vm X". vmctl/vmd have not forcibly terminated VMs in a while, we try to let vmmci(4) gracefully shutdown the VM, so "vmctl stop" commands are really requests to stop, not forced stops. The new message indicates that a shutdown is (possibly) in progress and not "complete".
2017-08-31vmd/vmctl: disallow use of block or character devices as disks in VMs.Mike Larkin
These don't work today and present the user with a confusing error message if an attempt is made to use them. This commit detects attempts to use block or character devices and if detected, presents the user with a better message. ok jasper From Carlos Cardenas, thanks!