script which permit me to launch all my vm thanks to qemu
Find a file
2024-02-02 00:47:03 +00:00
LICENSE Initial commit 2024-01-13 16:06:29 +01:00
README.md add another improvment for a next version 2024-02-02 00:47:03 +00:00
set-tap.sh change usage jaaj vm-start.sh and add possibility to add address to a new bridge 2024-02-01 15:41:55 +00:00
ssh-local.sh applied some corrections 2024-01-22 00:44:36 +00:00
vm-start.sh change usage jaaj vm-start.sh and add possibility to add address to a new bridge 2024-02-01 15:41:55 +00:00

vm-start

Description:

script which permit to launch easily some virtual machines via qemu

Dependencies:

  • qemu full installation

Functionnality:

  • create a config file to stores options for a vm [~]
  • start a vm while reading for the conf file [ok]
  • create a vm with the ability to choose an iso disk to launch the vm [ok]
  • del all sata related to a vm [~ok] (misses deleted conf file)
  • create a backup or being able to recall the bacup [ok] (can be improved)
  • start directly the backup file [ok]
  • can create only the conf file instead of starting/creating vm [ok]
  • list all vm already created [ok]
  • print help of version number [ok]
  • support option nproc to launch the vm with a different number of proc than precised in the config file [ok]
  • same for option memory [ok]
  • same for option size, size is only usefull when creating a vm [ok]
  • can support launching vm in uefi mode [ok] (doesn't fully support the UEFI in conf mode, preffer use the option uefi while launching vm.)
  • can add customs options to a vm [ok]
  • take option create_disk to know what disk to use when creating a vm. [ok]
  • compatible to an extensive network configuration [~ok] (can work either with nat or bridge of even without any network. By default it is one interface by nat, and don't work whith the config file yet.)

Things to add in the next verison

  • rename ssh-local.sh by connection.sh, and handle not only ssh, but rdp and vnc
  • add an option --windows which permit to launch a windows vm with no-graphics, and with the RDP port forward in order to access it easily by xfreerdp /v:localhost /u:'user' /dynamic-resolution

Usage:

to get some help;

vm-start --help

to list all vm already configured

vm-start --list

to create a new vm

vm-strart <nom_de_la_vm> create create_disk=<location_of_iso_file>

you can of course add options like uefi to tun in uefi mode, or nproc=<nb_proc> to select a number of processors.

If you go to the conf folder created the first time you launch the script, you will find all configured variables for each of your vm.

to connect two vm on different networks at a gateway nat.

first, run the script set-tap.sh to create two bridges.

set-tap.sh --add-br-id=br0
set-tap.sh --add-br-id=br1

after that change the mac address of all vm in conf folder.

vm-1 from 00:00:00:00:00:00 to 00:00:00:00:00:01
vm-2 from 00:00:00:00:00:00 to 00:00:00:00:00:02

and start the gateway and the vms after.

vm-start.sh gateway start net=br:br0 net=br:br1 net=nat:id01
vm-start.sh vm-1 start net=br:br0
vm-start.sh vm-2 start net=br:br1

And that's it, your three vm are now connected. You just have now to do some configurations on thoses vms.