aboutsummaryrefslogtreecommitdiff
path: root/share/examples/bhyve
Commit message (Collapse)AuthorAgeFilesLines
* vmrun.sh: add option for sharing directory via p9fs to bhyveDavid Marker2026-02-071-4/+30
| | | | | | Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55100
* vmrun.sh: Don't require firmware on amd64 unless -E was specifiedMark Johnston2025-10-161-2/+4
| | | | | | | PR: 290232 Reported by: David Marker <dave@freedave.net> Fixes: aa34b1d20e44 ("vmrun.sh: Add arm64 support") MFC after: 3 days
* vmrun.sh: Add arm64 supportMark Johnston2024-05-011-29/+71
| | | | | | | | | | | | | | | | For now, we enumerate disk devices before network devices. This is to work around a problem wherein u-boot remaps BARs during boot in a way that bhyve does not handle. Some discussion and experiments suggest that this can be handled by having bhyve not map BARs during boot on arm64; until a solution is implemented, however, this workaround is sufficient for simple usage and doesn't have any real downsides. The console and bootrom are specified slightly differently versus amd64, and a few of vmrun.sh's command-line options are amd64-only. Reviewed by: corvink, jhb Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D44933
* vmrun.sh: Stop passing -A to bhyveMark Johnston2024-04-241-1/+1
| | | | | | It's a no-op now. Sponsored by: Innovate UK
* vmrun.sh: allow device name arguments in pci-passthru optionChristos Margiolis2024-01-021-7/+18
| | | | | | | | | | This is more intuitive than having to run `pciconf -l` and figure out the bus/slot/func entry manually. Reviewed by: markj Sponsored by; The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43270
* vmrun.sh: add missing options in usage messageChristos Margiolis2024-01-021-1/+2
| | | | | | | Reviewed by: markj Sponsored by; The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43269
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* vmrun.sh: mention new edk2 packageChristos Margiolis2023-05-021-1/+1
| | | | | | | | | uefi-edk2-bhyve no longer exists. Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39937
* vmrun.sh: Fix a typo in usage()Mateusz Piotrowski2023-04-201-1/+1
| | | | | MFC after: 3 days Sponsored by: Klara Inc.
* vmrun: Expose bhyve's -G optionMark Johnston2023-03-201-2/+6
| | | | MFC after: 1 week
* Remove a space I missed in previous commitPoul-Henning Kamp2021-01-041-1/+1
|
* Remove -g option support which was removed from bhyve inPoul-Henning Kamp2021-01-041-7/+1
| | | | c4df8cbfde53c376d93f439eac3f45a7b4fc705e
* vmrun: Add a missing close-paren to the usage message.Mark Johnston2019-06-071-1/+1
| | | | | | | | MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=348782
* bhyve/vmrun.sh: make -L functional.Konstantin Belousov2018-06-241-1/+1
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days Notes: svn path=/head/; revision=335604
* Fold constants and unify vnc variable names.Rodney W. Grimes2018-02-021-10/+15
| | | | | | | | Approved by: grehan (mentor) MFC after: 3 days Notes: svn path=/head/; revision=328795
* Clean up long lines.Rodney W. Grimes2018-02-021-5/+8
| | | | | | | | Approved by: grehan (mentor) MFC after: 3 days Notes: svn path=/head/; revision=328784
* Add -n <network device emulation type> to usage synopsisRodney W. Grimes2018-02-011-14/+23
| | | | | | | | | | | | | forgotten in r328695. Fix long lines in usage. Consistently use "default:" rather than "default is" Approved by: grehan (mentor) MFC after: 3 days Notes: svn path=/head/; revision=328720
* Add option '-n' network device emulation type which has a default of virtio-netRodney W. Grimes2018-02-011-2/+8
| | | | | | | | | | PR: 225558 Submitted by: Johannes Lundberg <johalun0@gmail.com> Approved by: grehan (mentor) MFC after: 3 days Notes: svn path=/head/; revision=328695
* share and pc-sysinstall: adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Commit these apart because compile testing doesn't guarantee I didn't made some nasty mistake. No functional change intended. Notes: svn path=/head/; revision=326275
* vmrun.sh: add -A option for AHCI emulation of disk devicesAndriy Gapon2017-11-231-3/+8
| | | | | | | | | | | AHCI emulation is useful for testing scenarios closer to the real hardware. For example, it allows to exercise the CAM subsystem. There could be other uses as well. MFC after: 2 weeks Notes: svn path=/head/; revision=326140
* Add UEFI support to vmrun.shAllan Jude2017-04-131-9/+65
| | | | | | | | | | | | | | | | | | | Adds: -E: Use UEFI mode -f: path to UEFI firmware image (default: path to uefi-edk2-bhyve package) -F: UEFI framebuffer size (default: w=1024,h=768) -L: IP to listen for VNC connections on (default: 127.0.0.1) -P: Port to listen for VNC connections on (default: 5900) -T: Enable tablnet device (for VNC) -v: Wait for VNC client before booting VM Submitted by: Shawn Webb <shawn.webb@hardenedbsd.org> MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D10378 Notes: svn path=/head/; revision=316746
* Make vmrun.sh passthrough -u and -w to bhybeRodney W. Grimes2017-03-051-1/+9
| | | | | | | | | | PR: 214273 Submitted by: Martin Birgmeier <la5lbtyi@aon.at> Approved by: grehan MFC after: 1 week Notes: svn path=/head/; revision=314694
* Add option -l for specifying which OS loader to dlopen(3). By defaultMarcel Moolenaar2015-10-081-3/+7
| | | | | | | | this is /boot/userboot.so. This option allows for the development and use of other OS loaders. Notes: svn path=/head/; revision=289001
* Restructure memory allocation in bhyve to support "devmem".Neel Natu2015-06-181-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | devmem is used to represent MMIO devices like the boot ROM or a VESA framebuffer where doing a trap-and-emulate for every access is impractical. devmem is a hybrid of system memory (sysmem) and emulated device models. devmem is mapped in the guest address space via nested page tables similar to sysmem. However the address range where devmem is mapped may be changed by the guest at runtime (e.g. by reprogramming a PCI BAR). Also devmem is usually mapped RO or RW as compared to RWX mappings for sysmem. Each devmem segment is named (e.g. "bootrom") and this name is used to create a device node for the devmem segment (e.g. /dev/vmm/testvm.bootrom). The device node supports mmap(2) and this decouples the host mapping of devmem from its mapping in the guest address space (which can change). Reviewed by: tychon Discussed with: grehan Differential Revision: https://reviews.freebsd.org/D2762 MFC after: 4 weeks Notes: svn path=/head/; revision=284539
* bhyve/vmrun.sh: pass all existing readable disks to bhyveload(8)Andriy Gapon2015-06-051-7/+15
| | | | | | | | | | | | | | This is done if the installation mode is not requested or auto-detected. This is useful when a kernel has to be loaded from multiple disks. For example from a RAID-Z pool or a ZFS pool with multiple top level vdevs. Differential Revision: https://reviews.freebsd.org/D2723 Reviewed by: neel MFC after: 8 days Notes: svn path=/head/; revision=284024
* bhyve/vmrun.sh: support passing disk options same as for bhyve(8)Andriy Gapon2015-06-051-2/+6
| | | | | | | | | Differential Revision: https://reviews.freebsd.org/D2723 Reviewed by: neel MFC after: 8 days Notes: svn path=/head/; revision=284023
* Add -p parameter to list PCI device to pass through to the guest.Gleb Smirnoff2015-03-121-1/+15
| | | | | | | Reviewed by: neel Notes: svn path=/head/; revision=279925
* Make the error message explicit instead of just printing the usage if theNeel Natu2015-01-181-5/+11
| | | | | | | | | | virtual machine name is not specified. Requested by: grehan MFC after: 1 week Notes: svn path=/head/; revision=277309
* Use '-e' to check if the virtio backing file has already been created.Neel Natu2014-10-141-1/+1
| | | | | | | | | | | | The '-f' check works fine on a regular file but not if the backing file is a device (e.g., /dev/md0). In this case it would print a misleading but otherwise benign message about the backing file not being present. Submitted by: Marcus Reid (marcus@blazingdot.com) Discussed with: grehan Notes: svn path=/head/; revision=273102
* Propagate the error status of /usr/sbin/bhyve out of the vmrun.sh script.Craig Rodrigues2014-09-131-3/+14
| | | | | | | | | | Clean up the /dev/vmm entry for this VM when vmrun.sh exits. Reviewed by: neel Phabric: D767 Notes: svn path=/head/; revision=271496
* Attach the ISO to an ahci-cd emulated device. TheCraig Rodrigues2014-09-121-1/+1
| | | | | | | | | | | ISO will appear to be mounted on a /dev/cd device instead of /dev/vtbd. This is similar to how other virtualization environments handle mounting ISO images. Reviewed by: neel Notes: svn path=/head/; revision=271447
* Use "file -s", so that we can run vmrun.sh against special devices suchCraig Rodrigues2014-08-281-2/+2
| | | | | | | | | as /dev/md memory file systems Reviewed by: neel Notes: svn path=/head/; revision=270754
* If the VM was reset via "/sbin/reboot" or "shutdown -r",Craig Rodrigues2014-08-251-1/+2
| | | | | | | | | | then it is no longer necessary to "bhyvectl --destroy" the VM when it reboots. Move the "bhyvectl --destroy" outside of the while loop. Reviewed by: neel Notes: svn path=/head/; revision=270513
* Add comment which describes the exit status codes returned fromCraig Rodrigues2014-08-251-0/+8
| | | | | | | | | /usr/sbin/bhyve. These are in src/usr.sbin/bhyve/bhyverun.c. Reviewed by: neel Notes: svn path=/head/; revision=270512
* After r267897 brought in a new version of file/libmagic, a filesystem imageNeel Natu2014-06-271-1/+1
| | | | | | | | | | | | is identified as "DOS/MBR boot sector" as opposed to "x86 boot sector". This trips up vmrun.sh when using the new file(1) and makes it want to boot into the installer instead. Fix this by just looking for "boot sector" instead. Notes: svn path=/head/; revision=267963
* Support for multiple disks and tap devices.Alfred Perlstein2014-06-171-20/+59
| | | | | | | | | | | | This allows you to give a bhyve instance multiple network devices and disk devices easily by specifying additional "-d " and "-t " options. Reviewed by: neel Sponsored by: Norse Notes: svn path=/head/; revision=267559
* - Format the usage so that it fits in 80 cols and follows the standardJohn Baldwin2014-04-231-15/+31
| | | | | | | | | | | | | | | | | | | convention for long usage lines in manpages. - Sort the option string passed to getopts and the case statements for the option returned by getopts. - Add a -C option to specify the device to be used for the console (defaults to 'stdio') (This could be let vmrun be run in the background by using /dev/nmdm0B or the like) - Add a -H option to specify a host path to pass to bhyveload(8) via -h to back the host0: filesystem in bhyveload(8) (useful for loading kernels from the host into the guest without having to copy them into the guest's disk image first) Reviewed by: neel MFC after: 2 weeks Notes: svn path=/head/; revision=264837
* Make the virtual ioapic available unconditionally in a bhyve virtual machine.Neel Natu2013-10-311-1/+1
| | | | | | | | | | This is in preparation for moving the ioapic device model from userspace to vmm.ko. Reviewed by: grehan Notes: svn path=/head/; revision=257423
* Add support for PCI-to-ISA LPC bridge emulation. If the LPC bus is attachedNeel Natu2013-10-291-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to a virtual machine then we implicitly create COM1 and COM2 ISA devices. Prior to this change the only way of attaching a COM port to the virtual machine was by presenting it as a PCI device that is mapped at the legacy I/O address 0x3F8 or 0x2F8. There were some issues with the original approach: - It did not work at all with UEFI because UEFI will reprogram the PCI device BARs and remap the COM1/COM2 ports at non-legacy addresses. - OpenBSD GENERIC kernel does not create a /dev/console because it expects the uart device at the legacy 0x3F8/0x2F8 address to be an ISA device. - It was functional with a FreeBSD guest but caused the console to appear on /dev/ttyu2 which was not intuitive. The uart emulation is now independent of the bus on which it resides. Thus it is possible to have uart devices on the PCI bus in addition to the legacy COM1/COM2 devices behind the LPC bus. The command line option to attach ISA COM1/COM2 ports to a virtual machine is "-s <bus>,lpc -l com1,stdio". The command line option to create a PCI-attached uart device is: "-s <bus>,uart[,stdio]" The command line option to create PCI-attached COM1/COM2 device is: "-S <bus>,uart[,stdio]". This style of creating COM ports is deprecated. Discussed with: grehan Reviewed by: grehan Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com) M share/examples/bhyve/vmrun.sh AM usr.sbin/bhyve/legacy_irq.c AM usr.sbin/bhyve/legacy_irq.h M usr.sbin/bhyve/Makefile AM usr.sbin/bhyve/uart_emul.c M usr.sbin/bhyve/bhyverun.c AM usr.sbin/bhyve/uart_emul.h M usr.sbin/bhyve/pci_uart.c M usr.sbin/bhyve/pci_emul.c M usr.sbin/bhyve/inout.c M usr.sbin/bhyve/pci_emul.h M usr.sbin/bhyve/inout.h AM usr.sbin/bhyve/pci_lpc.c AM usr.sbin/bhyve/pci_lpc.h Notes: svn path=/head/; revision=257293
* Add an option to bhyveload(8) that allows setting a loader environment variableNeel Natu2013-10-171-3/+8
| | | | | | | | | | | | | from the command line. The option syntax is "-e <name=value>". It may be used multiple times to set multiple environment variables. Reviewed by: grehan Requested by: alfred Notes: svn path=/head/; revision=256657
* Parse the memory size parameter using expand_number() to allow specifyingNeel Natu2013-10-091-2/+2
| | | | | | | | | | | the memory size more intuitively (e.g. 512M, 4G etc). Submitted by: rodrigc Reviewed by: grehan Approved by: re (blanket) Notes: svn path=/head/; revision=256176
* Add the "-g <gdport>" option to the vmrun.sh script that enables remoteNeel Natu2013-03-281-3/+8
| | | | | | | | | | | debugging of the guest via kgdb. See also: https://wiki.freebsd.org/BHyVe/gdb Obtained from: NetApp Notes: svn path=/head/; revision=248840
* Add bhyve to examples.Neel Natu2013-03-181-0/+179
Requested by: alfred, julian Obtained from: NetApp Notes: svn path=/head/; revision=248484