frnmst-archives
/
qvm
Archived
1
0
Fork 0
Browse Source

Added SSH connection option. Updated readme.

dev
frnmst/Franco Masotti 6 years ago
parent
commit
b2c7eebcc3
  1. 5
      README.md
  2. 2
      configvmrc
  3. 11
      qvm

5
README.md

@ -10,6 +10,7 @@ It can handle:
- Basic network management: two ports are exposed to the host
machine (but you can add as many as you want). One of these
two ports is SSH (so admin gets simpler).
- Connection via SSH.
- Shared directory between host and guest.
- Last, but not least, running the virtual machine with all
these options.
@ -38,10 +39,6 @@ It can handle:
This will enable the shared directory automatically (no mount commands of any
sort).
- You can connect to your virtual machine via SSH, using the default values:
ssh -p 2222 <guest_user_name>@127.0.0.1
## License
CC0.

2
configvmrc

@ -25,6 +25,8 @@ guest_port="3050"
ssh_host_port="2222"
# vm port.
ssh_guest_port="22"
# vm guest user name
ssh_guest_username="vm"
shared_data_path="/home/parabola/dev/unife/qvm/shared_host_guest"
mount_tag="host_share"

11
qvm

@ -19,6 +19,7 @@ Usage: qvm [OPTION]
Trivial management of 64 bit virtual machines with qemu.
Options:
-a, --attack connect via ssh
-b, --backup backup vhd
-c, --create create new vhd
-d, --delete delete vhd backup
@ -42,6 +43,11 @@ unrecognized_option()
printf "%s\n" "Try 'qvm --help' for more information"
} 1>&2-
attach()
{
ssh -p "$ssh_host_port" -l "$ssh_guest_username" 127.0.0.1
}
backup()
{
qemu-img create -f "$vhd_type" \
@ -100,8 +106,8 @@ security_model=none,mount_tag="$mount_tag" \
main()
{
local argc="$1"
local options="bcdhir"
local long_options="backup,create,delete,delete-original\
local options="abcdhir"
local long_options="attach,backup,create,delete,delete-original\
,help,install,run,run-nox"
local opts
local opt
@ -120,6 +126,7 @@ main()
for opt in $opts; do
case "$opt" in
-- ) ;;
-a | --attach ) attach ;;
-b | --backup ) backup ;;
-c | --create ) create ;;
-d | --delete ) delete ;;