diff --git a/README.md b/README.md index b40b0ce..173f751 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ the same virtual machines - **Modularization**: `qemush` launching scripts are intended to be stackable to reuse common `qemu` parameters in all virtual machines needing them -- **Process supervision**: `qemush` uses `tmux` to supervise processes and keep track of them - **Copy-on-write**: images are formatted using `qcow2` to use less space on disk @@ -48,7 +47,6 @@ need it - `bash` - the `qemush` interpreter - `coreutils` - used for basic OS operations - `sudo` - execute commands as `qemu` -- `tmux` - for process supervision - `source-highlight` - for syntax highlighting when displaying launching scripts - `diskpath` and `sockpath` - see [Installation @@ -95,7 +93,6 @@ by the `Makefile` for the installation process. - Compile C programs from `src` in `~qemu/bin` with mode `740` - Copy the default launching scripts to `~qemu/launchers` with mode `740` - Copy `bin/qemush` to `/usr/local/bin/qemush` with mode `755` -- Copy the `tmux` configuration to the `qemu` user homedir ## Usage diff --git a/bin/qemush b/bin/qemush index 046d221..0991441 100755 --- a/bin/qemush +++ b/bin/qemush @@ -18,6 +18,7 @@ exec_as qemu "$@" # Directories used in the program bin="${HOME}/launchers" images="${HOME}/disks" +sockets="${HOME}/sockets" # Environment PATH="${bin}:${HOME}/bin:${PATH}" @@ -73,29 +74,27 @@ error_usage() { return 1 } -# Function to start a virtual machine ; fails if the virtual machine is -# already started thanks to tmux +# Function to start a virtual machine public_start() { QEMUSH_NAME="$1" shift - exec tmux new-session \ - -s "$QEMUSH_NAME" \ - "$QEMUSH_NAME" \ - "$@" + exec "$QEMUSH_NAME" "$@" } # Attach to a running virtual machine output, the latest opened if no # argument is provided public_watch() { - [ -n "$1" ] && set -- -t "$1" + QEMUSH_NAME="$1" + shift - exec tmux attach "$@" + socat -,echo=0,icanon=0 "UNIX-CONNECT:$(sockpath)" } # List running virtual machines public_active() { - exec tmux list-sessions + echo "Running machines:" + exec ls "$sockets" } # List available virtual machines entrypoints diff --git a/qemu/tmux.conf b/qemu/tmux.conf deleted file mode 100644 index 86e4d73..0000000 --- a/qemu/tmux.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Keep tmux sessions visible after exit -set -g remain-on-exit on - -# Override the nologin directive -set -g default-shell /bin/sh