aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-11-18run.py: Fix deprecated qemu readonly statementHEADmasterMatthias Brugger1-1/+1
Newer qemu warns about a depcrecated readonly statement: warning: short-form boolean option 'readonly' deprecated Please use readonly=on instead Fix this by using the correct readonly=on statement. Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2020-11-12aarch64: Fix aarch64 supportMatthias Brugger1-5/+10
When running virtme natively on a aarch64 host, we should use the same version of GIC as the host. We also don't need to emulate a CPU. Instead we can run on the host one. Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2020-11-11Merge branch 'arighi/master' into masterAndy Lutomirski1-0/+7
2020-11-11virtme-init: Clean up /etc/shadow generationAndy Lutomirski1-3/+3
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2020-11-11Merge pull request #63 from marcosps/fix_silentconfigAndrew Lutomirski1-1/+1
virtme-configkernel: Fix --allnoconfig option
2020-11-11Merge pull request #66 from morbidrsa/smpAndrew Lutomirski1-0/+5
run.py: introduce '--cpus' argument
2020-11-11run.py: introduce '--cpus' argumentJohannes Thumshirn1-0/+5
Introduce a --cpu argument to virtme-run, so we can set qemu's -smp commandline parameter. Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
2020-11-02virtme-init: generate dummy /etc/shadowAndrea Righi1-0/+7
Trying to switch to any non-root user from a virtme environment returns the following error: su: Authentication failure Populate dummy entries in /etc/shadow to allow switching to any user defined in the system. Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2020-08-20virtme-configkernel: Fix --allnoconfig optionMarcos Paulo de Souza1-1/+1
Kernel commit 911a91c39cab ("kconfig: rename silentoldconfig to syncconfig"), so also rename the updatetarget in virtme to reflect the change. Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
2020-07-20Minor sanitize_disk_args() cleanupAndy Lutomirski1-1/+1
'foo %s bar' % (baz) doesn't need parentheses. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2020-07-20Merge pull request #61 from marcosps/mpdesouza_blk-disksAndrew Lutomirski1-9/+24
run.py: Add blk-disks argument
2020-07-20run.py: Introduce --blk-disk argumentMarcos Paulo de Souza1-0/+9
This new argument will create a new virtio-blk device, instead of the scsi-blk that can be created by using --disk argument, accepting the same argument of --disk. By using --disk-blk "disk2=file1" will create /dev/disk/by-id/virtio-disk. Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
2020-07-20run.py: Extract path=file sanitizing into a new functionMarcos Paulo de Souza1-9/+15
This function will be used in the next patch. Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
2020-07-19Add more typing annotationsAndy Lutomirski3-15/+20
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2020-07-19Use -fsdev multidevs=remap on QEMU 4.2+Andy Lutomirski2-3/+10
Apparently having a virtfs export that spans multiple host filesystems can cause problems in the guest. QEMU 4.2+ will warn about this and supports a workaround: multidevs=remap. Probe for new enough QEMU and pass multidevs=remap on 4.2+. See #60. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2020-07-19Merge pull request #57 from soleen/pasha-cleanupAndrew Lutomirski1-6/+1
remove duplicated check from virtme-prep-kdir-mods
2020-07-19Merge pull request #62 from zeil/masterAndrew Lutomirski3-3/+3
Make scripts PATH friendly for searching python3
2020-07-19configkernel: Add CONFIG_INOTIFY_USER=yAndy Lutomirski1-0/+1
Per #34, this fixes udev. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2020-07-05Make scripts PATH friendly for searching python3Dmitry Yakunin3-3/+3
Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru>
2020-06-25Enable the Xen console when using --xenAndy Lutomirski1-1/+14
This causes Xen's console output to be visible. It's a horrible layering violation. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2020-04-15remove duplicated check from virtme-prep-kdir-modsPavel Tatashin1-6/+1
Existence of modules.order is checked twice. Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
2019-11-13modfinder: Use find_binary_or_raise() to find modprobeAndy Lutomirski2-3/+10
This should fix #53. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-11-13Add util.find_binary() to find binariesAndy Lutomirski2-19/+36
This factors the logic out from find_busybox() Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-18mkinitramfs: Improve the find_busybox algorithmAndy Lutomirski1-10/+16
Now the algorithm prefers the 'static' versions regardless of path, and it searches PATH first (for native) as advertised. See issue #52. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-17Merge branch 'master' of github.com:amluto/virtmeAndy Lutomirski1-1/+1
2019-10-17Merge pull request #52 from marcosps/mpdesouza_busybox_tumbleweedAndrew Lutomirski1-1/+1
mkinitramfs.py: Search for busybox{.,-}static first
2019-10-16mkinitramfs.py: Search for busybox{.,-}static firstMarcos Paulo de Souza1-1/+1
In currentl Tumbleweed, using busybox dynamic linked does not work. For now let's check if we have busybox static first. Fix: #51 Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
2019-10-16Fix the --mods error even better.Andy Lutomirski1-2/+2
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-16Fix the error message for --mods misuseAndy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-16Make --save-initramfs --show-command output more usefulAndy Lutomirski1-2/+5
Now --save-initramfs uses the actual filesystem path for QEMU's -initrd. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-16Add --save-initramfs to save the actual generated initramfsAndy Lutomirski1-7/+18
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-10README.md: get the release directory right this timev0.1.1Andy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-10Minor README.md fixAndy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-10Update README.md to link to releases.Andy Lutomirski1-1/+3
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-10Update .gitignore for mypyAndy Lutomirski1-1/+2
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-10Version 0.1.1Andy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-10Verify that --pwd and --cwd are not both setAndy Lutomirski1-1/+3
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-10Merge pull request #50 from marcosps/mpdesouza_ezequiel_cwdAndrew Lutomirski1-0/+9
run: Add a --cwd command to change the working directory
2019-10-10Version 0.1!v0.1Andy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-10Update README for modulesAndy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-09run: Add a --cwd command to change the working directoryEzequiel Garcia1-0/+9
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Marcos Paulo de Souza <mpdsouza@suse.com>
2019-10-06Rework arches to contain an actual dict of arch objectsAndy Lutomirski1-23/+27
This will make it possible to iterate over all supported arches to do clever things like detecting the architecture. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-05configkernel: Update cross-compiler adviceAndy Lutomirski1-5/+8
Linux removed CONFIG_CROSS_COMPILE: commit f1089c92da791034af73478159626007cba7f092 Author: Masahiro Yamada <yamada.masahiro@socionext.com> Date: Mon May 28 18:21:39 2018 +0900 kbuild: remove CONFIG_CROSS_COMPILE support Update virtme-configkernel to give instructions that actually work. Cross-compiling a kernel is annoying enough now that I think virtme should add some kind of helper to do the dirty work. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-05Fix a minor type error in run.pyAndy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-05riscv: Drop dependency on unmerged defconfig changes and update docsAndy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-05Add RISC-V supportPalmer Dabbelt2-0/+33
This expects a kernel with the plan 9 stuff supported (not yet in defconfig) and a new QEMU (as described in the README). I'm also not 100% sure it's working, as I'm getting /bin/sh: exec: line 1: /run/virtme/guesttools/virtme-init: not found Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2019-10-04Honor --mods=none with --installed-kernelAndy Lutomirski1-3/+7
It's unlikely that --installed-kernel actually works with --mods=none, but I think that we should try it and possibly fail to boot rather than just ignoring the --mods setting. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-04virtme-init: Mount tracefsAndy Lutomirski1-0/+1
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-10-02Merge pull request #48 from haggaie/masterAndrew Lutomirski1-2/+3
configkernel: Work in kernel build directories and not just source dirs
2019-10-02Merge pull request #45 from marcosps/opensuse_depmodAndrew Lutomirski1-0/+5
virtme-prep-kdir-mods: Check if depmod is in the user's PATH
2019-10-02Merge pull request #47 from marcosps/mpdesouza_cleanupAndrew Lutomirski3-5/+0
Remove not used imports
2019-10-02Merge pull request #46 from marcosps/remove_loadmodsAndrew Lutomirski3-30/+0
Remove not used virtme-loadmods script
2019-10-01Remove not used importsMarcos Paulo de Souza3-5/+0
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2019-09-30Remove not used virtme-loadmods scriptMarcos Paulo de Souza3-30/+0
This script is not being used since 865d8717c806 ("virtme-init: Turn off virtme-loadmods"). Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2019-09-30virtme-prep-kdir-mods: Add /usr/sbin to $PATHMarcos Paulo de Souza1-0/+5
openSUSE doesn't have /usr/sbin in the user's default path, so depmod cannot be found. This change makes virtme-run --mods=auto to work on openSUSE. Fixes: 3a65e4b514c0 ("Add virtme-prep-kdir-mods and support it") Signed-off-by: Andrea Righi <andrea.righi@canonical.com> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2019-09-27Add more type annotations and fix run return value bugletAndy Lutomirski1-8/+10
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-09-27Detect CONFIG_MODULES=n and fix a silly bugAndy Lutomirski1-7/+25
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-09-27Fix --mods=auto with --kdir != .Andy Lutomirski3-6/+7
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-09-27Add a bunch more type annotationsAndy Lutomirski5-16/+25
mypy --check-untyped-defs -p virtme passes now Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-09-27Print a less awful error message when virtme-prep-kdir-mods failsAndy Lutomirski1-4/+20
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-09-27Make run.py pass mypy --check-untyped-defsAndy Lutomirski2-6/+19
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-09-27Return a class instance from find_kernel_and_mods()Andy Lutomirski1-29/+34
The output was getting too messy. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-09-27Fix copyright notice in virtme-mkinitramfsAndy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-09-27Merge pull request #39 from marcosps/mpdesouza_mkinitramfsAndrew Lutomirski3-30/+63
Make virtme-mkinitramfs great again
2019-09-27Merge branch 'kmod'Andy Lutomirski6-18/+130
This is hopefully good enough for master now.
2019-09-27kmod: Improve logic to find and run virtme-prep-kdir-modsAndy Lutomirski3-3/+26
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-09-27Merge marcos' fix in to the kmod branchAndy Lutomirski1-1/+1
2019-09-27Merge pull request #44 from zevweiss/kmodAndrew Lutomirski1-1/+1
Fix module-finding in $KDIR/.virtme_mods
2019-09-27Merge pull request #41 from zevweiss/misc-fixesAndrew Lutomirski2-1/+2
Miscellaneous small fixes
2019-09-27Merge pull request #43 from marcosps/mpdesouza_issue7Andrew Lutomirski1-1/+8
commands/configkernel.py: Check KBUILD_OUTPUT environment variable
2019-09-27Merge pull request #40 from zevweiss/more-bbox-pathsAndrew Lutomirski1-6/+7
More potential paths for busybox executable
2019-09-27virtme-run: pass .virtme_mods as root to find_modules_from_install().Zev Weiss1-1/+1
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2019-09-21commands/configkernel.py: Check KBUILD_OUTPUT environment variableMarcos Paulo de Souza1-1/+8
If KBUILD_OUTPUT is defined, and if it's a directory, write the .config file in location defined. Fixes: #24 Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2019-09-21setup.py: Add virtme-mkinitramfs to console_scriptsMarcos Paulo de Souza1-0/+1
With this commit, virtme-mkinitramfs is installed like virtme-run and virtme-configkernel. Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2019-09-21commands/initramfs.py: Add outfile argumentMarcos Paulo de Souza1-1/+9
This new argument waits for a string where the new initrd file will be placed. If not informed, the file is printed in the stdout, which is the current behavior. Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2019-09-21commands/mkinitramfs.py: Add make_parserMarcos Paulo de Souza1-6/+13
Following the same pattern of run.py. Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2019-09-21commands/mkinitramfs.py: Set config.busyboxMarcos Paulo de Souza1-0/+3
When creating the initramfs, busybox is needed, so search for it in the root filesystem. Suggested-by: Andy Lutomirsky <luto@kernel.org> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2019-09-21Add virtme-mkinitramfsMarcos Paulo de Souza1-0/+15
Is a shell script, very similar to virtme-run, that call mkinitramfs.main function to create an initram image. Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2019-09-21mkinitramfs.py: Fix importsMarcos Paulo de Souza1-3/+3
Now that mkinitramfs.py lives inside commands, we can safely do relative imports, as run.py already does. Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2019-09-21Move virtme-mkinitramfs to virtme/commands/mkinitramfs.pyMarcos Paulo de Souza1-1/+0
Later patches will fix mkinitramfs.py and make use of it. Suggested-by: Andy Lutomirsky <luto@kernel.org> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2019-09-21virtme-run: introduce option --modsAndrea Righi1-13/+30
Introduce new argument --mods none|use|auto to be used in conjunction with --kdir to determine how virtme's kernel modules directory is generated/updated inside a compiled kernel source directory. The following arguments are currently supported: - none: ignore kernel modules - use: asks user to refresh virtme's kernel modules directory by running virtme-prep-kdir-mods - auto: automatically refreshes virtme's kernel modules directory Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2019-09-17refresh kernel modules directory when modules.order is updatedAndrea Righi1-1/+6
Make sure to refresh the kernel modules' directory when modules.order changes. Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2019-09-17mkinitramfs: indicate failure if dummy modprobe script is calledZev Weiss1-0/+1
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2019-09-17virtme-run: fix --disk device-name checkZev Weiss1-1/+1
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2019-09-17mkinitramfs: add candidate suffix for static busyboxZev Weiss1-1/+1
Void Linux's busybox-static package, for example, installs it as 'busybox.static'. Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2019-09-17mkinitramfs: generate busybox paths instead of enumerating them explicitlyZev Weiss1-6/+7
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2019-09-14automatically setup virtme kernel modules directoryAndrea Righi1-2/+10
Call virtme-prep-kdir-mods from virtme-run to automatically setup virtme's modules directory when possible. Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2019-08-29virtme-prep-kdir-mods: Add a better error message and fix shellcheck warningsAndy Lutomirski1-1/+6
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-08-19virtme-prep-kdir-mods: correctly parse modules from modules.orderAndrea Righi1-0/+1
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2019-08-16virtme-prep-kdir-mods: get modules from modules.orderAndrea Righi1-2/+2
Get the list of kernel modules from modules.order, otherwise we may miss some of them in the temporary virtme module directory. Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2019-08-16Add virtme-prep-kdir-mods and support itAndy Lutomirski4-18/+63
This is still experimental. With this patch, you can run virtme-prep-kdir-mods, and then virtme-run --kdir will pick up modules from the kernel directory. Known issues: - There are no docs. - This is unlikely to work well if forced module signing is on. An option to virtme-prep-kdir-mods could be added to work around that, but it would run slower. - There is no intelligent handling for the case where the kernel was modified and rebuilt but virtme-prep-kdir-mods was re-run. Because it uses symlinks, it will only load modules that still have their .ko files around, but virtme-run won't notice the discrepency. Maybe file timestamps could be used to try to detect this. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-08-16Merge branch 'kmod' of https://github.com/arighi/virtme into kmodAndy Lutomirski1-7/+15
2019-08-15Merge pull request #32 from marcosps/mpdesouza_modprobe_suse with fixesAndy Lutomirski1-1/+4
2019-08-15modfinder.py: Tidy up the search for modprobeAndy Lutomirski1-2/+2
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-08-15Merge pull request #36 from wenjianhn/dhcpAndrew Lutomirski1-1/+1
Using udhcpc default retries
2019-08-15Merge pull request #37 from arighi/masterAndrew Lutomirski1-2/+10
virtme-init: correctly initialize resolv.conf under ubuntu
2019-08-14virtme-run: provide a way to support modules with --kdirAndrea Righi1-7/+15
When --kdir is provided there's not an easy and automated way to use kernel modules from the guest. A possible solution could be to install all the modules inside the kernel build directory (argument of --kdir) inside a temporary directory .tmp_moddir/ as following: $ make modules_install INSTALL_MOD_DIR=.tmp_moddir In this way if .tmp_moddir is found the guest can use the kernel modules from this directory, otherwise fallback to the old behavior and do not provide an automated way to access the kernel modules. TODO: document this .tmp_moddir/ directory somewhere. Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2019-08-13virtme-init: correctly initialize resolv.conf under ubuntuAndrea Righi1-2/+10
In recent distro (i.e., Ubuntu) resolv.conf is a symlink to /run/systemd/resolve/stub-resolv.conf that is not visible by the guest. This results in a failure when trying to initialize this file. Make sure to resolve the symlink first and initialize the actual file with an empty file before trying to rewrite its content. Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2019-08-06Using udhcpc default retriesJacob Wen1-1/+1
I've re-used the bridge of libvirtd. A vm gets it lease by the 3rd dhcp requests. Log of udhcpc without this patch. udhcpc: sending discover udhcpc: no lease, failing Log of udhcpc with this patch. udhcpc: started, v1.27.2 udhcpc: sending discover udhcpc: sending discover udhcpc: sending select for 192.168.123.76 udhcpc: lease of 192.168.123.76 obtained, lease time 3600 This patch removes the '-t' arg to use the default retries which is 3. Signed-off-by: Jian Wen <wenjianhn@gmail.com>
2019-08-05configkernel: Work in kernel build directories and not just source dirsHaggai Eran1-2/+3
Signed-off-by: Haggai Eran <haggai.eran@gmail.com>
2019-06-20modfinder.py: Check if modprobe is the PATH of the userMarcos Paulo de Souza1-1/+4
openSUSE and SLE don't have modprobe in the user's PATH, so check /usr/sbin too. With this patch applied, an ordinary user can execute virtme-run --installed-kernel Without the need to be root in openSUSE/SLE. Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
2019-06-17Added --show-boot-console option to show the boot consoleJames Yonan1-3/+10
when running scripts. Signed-off-by: James Yonan <james@openvpn.net>
2019-06-17Add very basic --net=bridge supportAndy Lutomirski1-2/+13
This isn't obviously terribly useful without careful configuration of the host. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-06-17Use modern QEMU network configurationAndy Lutomirski1-2/+2
-net is outdated. Use -device and -netdev as recommended by the QEMU manpage. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-06-17Merge pull request #31 from lmb/respect-rw-initramfsAndrew Lutomirski3-5/+14
Respect --rw flag in initramfs
2019-06-17virtme-mkinitramfs: add --rw flagLorenz Bauer1-0/+4
Mirror the --rw flag from virtme-run. Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
2019-06-17mkinitramfs: respect --rw flagLorenz Bauer2-5/+10
Make the initramfs mount the root filesystems read-write if the user requested it via the --rw flag. Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
2019-06-16Merge commit 'refs/pull/29/head' of github.com:amluto/virtmeAndy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-06-16Merge commit 'refs/pull/28/head' of github.com:amluto/virtmeAndy Lutomirski1-1/+4
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-06-16Improve error handling if cgroup mounting failsAndy Lutomirski1-3/+4
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-06-16Merge branch 'cgroupv2' of git://github.com/arighi/virtmeAndy Lutomirski1-0/+5
PR #26 Signed-off-by: Andy Lutomirski <luto@kernel.org>
2019-05-09virtme-init: use findmnt to detect /dev mountlmb1-1/+1
In my environment, /dev is available via the 9p root mount, and therefore virtme-init does not mount a fresh devtmpfs. This means that udevd later is unable to generate new entries for /dev/vport*. Using --script-sh or --script-exec therefore fails. Instead, use findmnt to check whether /dev is automounted by the current kernel. Signed-off-by: Lorenz Bauer <i@lmb.io>
2019-05-09virtme-init: create mountpoints if they don't existlmb1-1/+4
Using a shared folder like --rwdir=/run/output=/path/on/host fails, since the mountpoint under /run does not exist. Create the mountpoint if it doesn't exist. Also abort the script if mounting fails. Signed-off-by: Lorenz Bauer <i@lmb.io>
2019-03-27run.py: Add --memory argumentMarcos Paulo de Souza1-0/+5
This new flag sets the "-m" flag of QEMU, letting the user to user the amount of memory the guest will have. Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com> Message-Id: <20190328022819.1143715-1-marcos.souza.org@gmail.com>
2019-03-01virtme-init: mount cgroup v2Andrea Righi1-0/+5
Automatically mount cgroup v2 filesystem under /sys/fs/cgroup/unified as it seems a pretty standard place and tools relying on cgroupv2 are expecting to find this filesystem mounted there. Signed-off-by: Andrea Righi <righi.andrea@gmail.com>
2018-11-02guest_tools: Remove support for guest tools in .../share/...Andy Lutomirski1-11/+0
The guest tools are not always package resources. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2018-11-02setup.py: Set zip_safe to falseAndy Lutomirski1-1/+5
We're not doing ourselves any favors by being installed as a zip file -- the guest tools need to get extracted to do anything. It works, but still. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2018-11-02setup.py: Explicitly list guest data filesAndy Lutomirski1-2/+6
I don't like autodiscovering files in the filesytem. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2018-10-03Require setuptools only for setupEzequiel Garcia1-5/+1
The distutils.setup doesn't preserve package data file permission, which makes it problematic when installing virtme-guest scripts. Get rid of it, and instead require setuptools.
2018-10-03Transform virtme/guest into a Python packageGuilherme Alcarde Gallo2-8/+4
setup.py doesn't copy the necessary bash files from virtme/guest folder to the installed folder. This can be solved if we transform virtme/guest folder, which only have bash scripts, into a python package by add a __init__.py file and instructing setup.py that virtme.guest is a package and we will need its contents as package data. This idea was based on the setuptools docs advice: https://setuptools.readthedocs.io/en/latest/setuptools.html#non-package-data-files
2018-06-25virtme-run: Look for installed-kernel images in /usr/lib/modulesAndy Lutomirski1-1/+3
On Fedora, /usr/lib/modules contains vmlinuz files. Since /boot access is always a little bit dicey, try /usr/lib/modules first. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2018-04-28README: Update mentions to prereqs.config fileEzequiel Garcia1-2/+5
Replace the mentions to prereqs.config file with the virtme-configkernel tool. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
2017-11-25Merge https://github.com/amluto/virtme/pull/12Andy Lutomirski2-0/+12
2017-11-25Merge pull request #17 from zevweiss/resolvconf-fixAndrew Lutomirski1-0/+1
virtme-udhcpc-script: make resolv.conf world-readable. Arguably a nicer solution would be to name the file /run/virtme/resolv.conf, but that's a different issue entirely.
2017-11-24virtme-run: add --name flagZev Weiss2-0/+12
Sets hostname in guest init and passes it to qemu's '-name' flag for easier identification. Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2017-11-24virtme-init: make resolv.conf world-readable.Zev Weiss1-0/+1
'mktemp' creates files that are only accessible to the current user (and doesn't have any options to change this), but in this case the file we're creating is going to end up as resolv.conf, which should be world-readable. So here we manually chmod it as such after creating it. Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2017-11-22Merge pull request #15 from fzago-cray/forupstreamAndrew Lutomirski2-1/+4
Minor changes for Debian/Ubuntu and OpenSUSE
2017-11-22Add path to busybox-static for openSUSEFrank Zago1-0/+1
On OpenSUSE, /usr/bin/busybox is a dynamic binary, while /usr/bin/busybox-static is static. We need the static version, so add it. Signed-off-by: Frank Zago <fzago@cray.com>
2017-11-22Add resolv.conf path for DebianFrank Zago1-1/+3
On Ubuntu, the real resolv.conf is in /run/resolvconf, not /run/NetworkManager, so that create that path in the VM as well. Signed-off-by: Frank Zago <fzago@cray.com>
2017-11-21Merge part of PR #10, improving Ubuntu support.Andy Lutomirski1-0/+2
2017-11-21README: remove some taken-care-of TODO itemsZev Weiss1-3/+1
--rw/--rwdir and --script-sh/--script-exec provide these features now. (Also tack on a newline at EOF.) Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Signed-off-by: Andy Lutomirski <luto@kernel.org>
2017-11-21Merge two commits from PR #12Andy Lutomirski1-1/+14
2017-04-20virtme-init: Mount configfs and debugfs if availableAndy Lutomirski1-0/+4
This removes some steps in using a bunch of testing tools. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2017-03-21virtme-init: create /dev/{fd,std{in,out,err}} symlinksZev Weiss1-0/+10
bash, for example, wants /dev/fd to exist for implementing process substitution (e.g. 'cat <(echo hello)'). Might as well provide the usual three stdio links while we're there. Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2017-03-21virtme-init: avoid a warning from bashZev Weiss1-1/+4
As of version 4.4 bash now warns about null bytes in command substitutions. Sidestep it here by using sed to strip the null terminator off the contents of 9pnet_virtio's mount_tag sysfs attributes. Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2017-03-02Provide search path for systemd-udevd on Ubuntu 16.James Yonan1-0/+2
Signed-off-by: James Yonan <james@openvpn.net>
2016-11-27Merge branch 'master' of https://github.com/zevweiss/virtmeAndy Lutomirski3-8/+11
This improves script mode.
2016-11-27Merge pull request #8 from zevweiss/non-tty-stdoutAndrew Lutomirski1-3/+9
virtme-run: Handle non-tty stdout
2016-11-27virtme-run: Handle non-tty stdoutZev Weiss1-3/+9
Catch and ignore ENOTTY exceptions from os.get_terminal_size(). Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2016-10-27mkinitramfs: Remove leading slash from /run_virtme/dataZev Weiss1-1/+1
Doesn't make any real difference to the guest, but avoids trying to put things in / when unpacking the cpio archive for debugging purposes. Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2016-10-27virtme-run: Don't use exec for --script-shZev Weiss1-4/+4
This allows passing multiple semicolon-delimited shell commands. Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2016-10-27virtme-init: Fix virtme.scriptio I/O redirectionZev Weiss1-1/+1
The <> redirection defaults to stdin, not stdout, so redirect file descriptors 1 and 2 to 0. Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2016-10-27virtme-run: Don't mount second /run tmpfs with initramfsZev Weiss1-2/+2
The _INIT script in mkinitramfs.py mounts a tmpfs on /run; mounting another one over it hides /run/virtme, breaking --script-sh and --script-exec (which execute a script from /run/virtme/data). Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2016-10-27virtme-run: Decompose initargs into discrete commandsZev Weiss1-2/+5
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
2016-10-27Add a Developer's Certificate of OriginAndy Lutomirski2-0/+37
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2016-06-24virtme-udhcpc-script: Create /run/NetworkManagerAndy Lutomirski1-0/+4
This is a silly workaround for /etc/resolv.conf being a symlink to /var/run/NetworkManager/resolv.conf. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2016-06-24virtme-init: Explicitly probe for the address of the --net nicAndy Lutomirski1-1/+4
Modern systemd renames it, so probe to find its new name. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2016-06-24virtme-init: Forcibly create /run/dbusAndy Lutomirski1-0/+3
This makes dbus a bit more reliable, which improves the (low) chance that a full graphical session works correctly inside virtme. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2016-04-30virtme-run: Don't panic if an unrecognized argument is passed to -aAndy Lutomirski1-2/+6
The kernel interprets: init=/bin/sh foobar -- baz quux as a request to run /bin/sh foobar baz quux, unless foobar is a known kernel parameter. As a result, passing '-a foobar' to virtme-run will panic the guest. I think this is a bug or design error in the kernel argument parser. Fortunately, there's another counterbalancing quirk: foobar init=/bin/sh -- baz quux will cause foobar to be ignored because init=/bin/sh resets accumulated init arguments. Reorder our argument generation to take advantage of this quirk and avoid panicking if a bad argument is passed. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2016-03-11virtme-run: Fix -a/--koptAndy Lutomirski1-3/+4
When I added '--' support, I put user-specified kopts on the wrong side of the '--'. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2016-02-23Bump to 0.0.3Andy Lutomirski1-1/+1
2016-02-23Fix guest tools searchAndy Lutomirski1-7/+5
2016-02-23Add --rodir to complement --rwdirAndy Lutomirski1-4/+8
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2016-02-23Grab guest tools from a separate mount even w/o initramfsAndy Lutomirski4-61/+14
We no longer require guest tools to exist in the rootfs to avoid initramfs, nor do we even try to use it if it's there. Instead we pull it in using virtfs and boot from it using the '--' kernel command line feature to embed a scriptlet. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2016-02-01virtme-init: Split udevadm invocationAndy Lutomirski1-1/+2
This is how systemd does it, so it's probably a good idea. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2016-01-07virtme-init: Set a HOME directoryAndy Lutomirski1-0/+4
Everything works better if HOME points somewhere writable. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2016-01-07virtme-init: Run systemd-tmpfiles if availableAndy Lutomirski1-0/+6
A bunch of service depend on /run being fully set up, and systemd-tmpfiles is a common way to set it up. Invoke it. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-12-07Disable uevent_helper (compile-time and runtime) and warn about itAndy Lutomirski2-0/+10
It's slow, and it triggers a lockup under some circumstances. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-12-03configkernel: Add --update to fix up an existing configAndy Lutomirski1-7/+13
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-12-03configkernel: For x86, set bitness like all the other architecturesAndy Lutomirski2-5/+1
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-12-03architectures: For x86, use ARCH=x86Andy Lutomirski1-0/+5
We can, and there's no need to treat x86 as special. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-11-06Split gccname from qemunameAndy Lutomirski2-2/+7
This will allow things like building sparc32 using a sparc64 toolchain. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-11-06run: Respect arch.qemunameAndy Lutomirski1-4/+4
All current arches have qemuname matching the arch name, but this may change for future arches. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-10-30run: Add --rw to export and mount the rootfs read-writeAndy Lutomirski1-2/+5
This also fixes a silly bug in which the rootfs had a useless "ro" string option. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-10-30virtme-init: Improve behavior when udevd is missingAndy Lutomirski1-3/+7
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-10-29Add sparc64 supportAndy Lutomirski2-4/+27
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-10-29README.md: Various updatesAndy Lutomirski1-6/+10
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-10-29architectures: Add ppc64Andy Lutomirski1-0/+20
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-10-29Add --kdir supportAndy Lutomirski2-16/+43
This makes arm in particular much easier to use because it picks up the dtb file automatically. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-10-29architectures: Add basic s390x supportAndy Lutomirski1-8/+16
This is enough to get some console output. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-10-28arm: Switch to vexpress-a15Andy Lutomirski1-7/+8
The versatilepb thing wasn't really working, and vexpress-a15 is modern and functional. This will remain awkward to use until I add generic device tree support. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-10-16initramfs: Use the fallback tmpfs if there's no /runAndy Lutomirski1-2/+10
CentOS 6 is mostly compatible with virtme and has a fully functional QEMU, but it's missing /run. Use the fallback tmpfs if that happens. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-10-16modfinder: Don't use modprobe -S unless necessaryAndy Lutomirski1-2/+4
This will improve compatibility with CentOS 6, according to GitHub issue 5. Signed-off-by: Andy Lutomirski <luto@kernel.org>
2015-04-01virtme-init: Don't openvt a bunch of vts when we're using a text consoleAndy Lutomirski1-6/+9
Signed-off-by: Andy Lutomirski <luto@kernel.org>
2014-11-21virtme-init: If we don't have explicit modules, block implicit modulesAndy Lutomirski1-1/+5
This fixes crashes when using --kimg on a kernel image with a version that matches an installed kernel. Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-11-12virtme-run: Allow '-' in --rwdirAndy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-11-05virtme-run: Add preliminary support for read/write directoriesAndy Lutomirski2-2/+39
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-11-05mkinitramfs: Fix typoAndy Lutomirski1-1/+1
Noticed by Tom H. Thanks. Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-10-27x86: Enable nested virt in configkernelAndy Lutomirski1-0/+5
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-10-15x86: Select CONFIG_KVM_GUEST in configkernelAndy Lutomirski1-0/+3
This behaves considerably better. Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-10-09Print a more helpful error if the Python version is too oldAndy Lutomirski3-2/+12
For Python 3.2 support, virtme would need to adjust how it uses os.uname() and it would need a replacement for shutil.which(). The latter is annoying enough that I don't really want to do it. Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-23virtme-run: Add --pwd optionAndy Lutomirski1-0/+11
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-16configkernel: Fix a traceback on argument failureAndy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-10Remove .spec fileAndy Lutomirski1-61/+0
It doesn't really work, and there's a fancier version out for Fedora review. Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-10setup.py: Add canonical download URLAndy Lutomirski1-1/+4
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-10Remove unnecessary #!/usr/bin/python3 headers in modulesAndy Lutomirski9-9/+0
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09Add make-release-tarball.shv0.0.1Andy Lutomirski1-0/+10
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09Add some code to try to support s390x, currently very brokenAndy Lutomirski1-0/+23
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09virtme-configkernel: New command to automatically configure a kernelAndy Lutomirski5-32/+191
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09[BREAKING CHANGE] Make console mode the defaultAndy Lutomirski2-10/+12
I suspect that most users will want a terminal most of the time. Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09README.md: Update to note that ppc64 worksAndy Lutomirski1-0/+5
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09.gitignore: Add build and distAndy Lutomirski1-0/+2
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09setup.py: Fix typo in the descriptionAndy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09setup.py: Update classifiersAndy Lutomirski1-1/+6
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09README.md, setup.py: Update the description a little bitAndy Lutomirski2-2/+3
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09Add a manifest (fixing sdist and partially fixing bdist_rpm)Andy Lutomirski1-0/+3
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09setup.py: Slightly improve long_description generationAndy Lutomirski1-2/+5
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09setup.py: The license should be a short stringAndy Lutomirski1-1/+1
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-09-09add a spec for packaging virtme in an rpmVincent Batts1-0/+61
2014-09-09Move guest tools into virtme/guest and hopefully fix installationAndy Lutomirski7-28/+101
Signed-off-by: Andy Lutomirski <luto@amacapital.net>