add networking options

This commit is contained in:
primardj 2024-01-31 23:26:37 +00:00
parent 247578fcb5
commit de44bbf565

View file

@ -37,6 +37,9 @@ OPTION available
options=<option> additinal options to give to qemu. By default is
-display gtk -vga qxl
create_disk=<loc_disk> Def a create disk to boot on. Is necessary for using create, or need the variable INSTALLATION_DISK_LOCATION to be set.
net=nat Add a nat connection to the vm. By default there is already one #TODO
net=tap<tapInterface> Connect the vm to the tap interface <tapInterface>. Please use the script set-tap.sh as root to create the tap interface. #TODO
net=none The vm will have no network interface #TODO
"
MAIN_LOCATION="$HOME/virtual_machine"
@ -103,6 +106,8 @@ start_the_vm() {
-smp "$NPROC" \
-net nic \
-net user"$FORWARD",hostname="$VMHOSTNAME" \
-netdev user,id=id01,net=192.168.76.0/24,dhcpstart=192.168.76.9 \
-device virtio-net,netdev=id01 \
-m "$MEMORY" \
-drive file="${MAIN_LOCATION}/${LOCATION}/${VMDRIVE}",index=2,id=maindrive,media=disk \
$OPTION