Removed extra --ssh-port option, supply port from --ssh option instead
This commit is contained in:
parent
94980fd722
commit
b936fce5fb
@ -75,7 +75,6 @@ You can also pass optional parameters
|
||||
--snapshot : Create a disk snapshot.
|
||||
--virgil : Use virgil, if available.
|
||||
--ssh : Enable SSH to the machine (disabled by default).
|
||||
--ssh-port : Local port to forward to the machine (default 2222).
|
||||
```
|
||||
|
||||
### SSH Access
|
||||
@ -84,12 +83,12 @@ SSH access to the QEMU virtual machine can be enabled by using the `--ssh` flag.
|
||||
|
||||
This does not install or start an SSH server within the guest itself, so you may need to enable this on a per-guest basis. For Ubuntu guests, you can enable this by installing `openssh-server`.
|
||||
|
||||
If the default port overlaps with another service on your host, you can override this with `--ssh-port $PORT`. This will still forward to port `TCP22` on the guest machine.
|
||||
If the default port overlaps with another service on your host, you can override this with `--ssh $PORT`. This will still forward to port `TCP22` on the guest machine.
|
||||
|
||||
Example of usage: -
|
||||
|
||||
```
|
||||
$ ./quickemu.sh --vm mate.conf --ssh --ssh-port 1111
|
||||
$ ./quickemu.sh --vm mate.conf --ssh 1111
|
||||
Starting mate.conf
|
||||
- BIOS: Legacy
|
||||
- Disk: /home/$USER/Applications/quickemu/ubuntu-mate/focal-desktop-amd64.qcow2
|
||||
|
12
quickemu.sh
12
quickemu.sh
@ -184,7 +184,6 @@ function usage() {
|
||||
echo " --snapshot : Create a disk snapshot."
|
||||
echo " --virgil : Use virgil, if available."
|
||||
echo " --ssh : Enable SSH to the machine (disabled by default)."
|
||||
echo " --ssh-port : Local port to forward to the machine (default 2222)."
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -196,7 +195,6 @@ ENGINE="system-x86_64"
|
||||
RESTORE=0
|
||||
SNAPSHOT=0
|
||||
SSH=0
|
||||
SSH_PORT=2222
|
||||
VM=""
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
@ -218,10 +216,12 @@ while [ $# -gt 0 ]; do
|
||||
shift;;
|
||||
-ssh|--ssh)
|
||||
SSH=1
|
||||
shift;;
|
||||
-ssh-port|--ssh-port)
|
||||
SSH_PORT=$2
|
||||
shift
|
||||
if [[ $2 =~ ^[0-9]+$ ]]; then
|
||||
SSH_PORT=$2
|
||||
shift
|
||||
else
|
||||
SSH_PORT=2222
|
||||
fi
|
||||
shift;;
|
||||
-vm|--vm)
|
||||
VM="$2"
|
||||
|
Loading…
Reference in New Issue
Block a user