VM RAM & cores configuration
This commit is contained in:
parent
f00f9babee
commit
00f4e5ca4e
2 changed files with 23 additions and 8 deletions
12
scripts/qemu/debian-test
Executable file
12
scripts/qemu/debian-test
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
qemu-system-x86_64 -enable-kvm --daemonize \
|
||||
-cpu host \
|
||||
-smp 4 \
|
||||
-drive format=raw,file=/media/platvoeten/VM/debian-test.img,if=virtio \
|
||||
-m 4G \
|
||||
-name debian \
|
||||
-vga qxl \
|
||||
-spice port=5911,disable-ticketing \
|
||||
-device virtio-serial \
|
||||
-chardev spicevmc,id=vdagent,name=vdagent \
|
||||
-device virtserialport,chardev=vdagent,name=com.redhat.spice.0
|
||||
|
|
@ -14,6 +14,13 @@ create_script() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# VM configuration
|
||||
read -p "Enter the VM name and press [ENTER]: " NAME
|
||||
read -p "Enter the port number and press [ENTER]: " PORT
|
||||
read -p "Enter qemu script's name and press [ENTER]: " FILE
|
||||
read -p "Enter the amount of RAM [1G/4G]: " RAM
|
||||
read -p "Enter the number of cores the guest can use [1/4]: " CORES
|
||||
|
||||
read -p "Boot disk needed? [y/n]: " ANSWER
|
||||
if [ "$ANSWER" == "y" ] ;then
|
||||
read -e -p "Enter the Boot disk path and press [ENTER]: " BOOT_DISK
|
||||
|
|
@ -21,12 +28,6 @@ create_script() {
|
|||
echo "Okay, dropping boot disk"
|
||||
fi
|
||||
|
||||
read -p "Enter the VM name and press [ENTER]: " NAME
|
||||
|
||||
read -p "Enter the port number and press [ENTER]: " PORT
|
||||
|
||||
read -p "Enter qemu script's name and press [ENTER]: " FILE
|
||||
|
||||
# Creation of script
|
||||
touch "$HOME/.bin/qemu/$FILE"
|
||||
chmod +x "$HOME/.bin/qemu/$FILE"
|
||||
|
|
@ -35,9 +36,10 @@ create_script() {
|
|||
echo -e '#!/bin/bash \n' \
|
||||
'qemu-system-x86_64 -enable-kvm --daemonize \' '\n' \
|
||||
'\t -cpu host \' '\n' \
|
||||
'\t -smp '$CORES' \' '\n' \
|
||||
'\t -drive format=raw,file='$DISK',if=virtio \' '\n' \
|
||||
'\t -boot d -cdrom '$BOOT_DISK' \' '\n' \
|
||||
'\t -m 4G \' '\n' \
|
||||
'\t -m '$RAM' \' '\n' \
|
||||
'\t -name '$NAME' \' '\n' \
|
||||
'\t -vga qxl \' '\n' \
|
||||
'\t -spice port='$PORT',disable-ticketing \' '\n' \
|
||||
|
|
@ -49,8 +51,9 @@ create_script() {
|
|||
echo -e '#!/bin/bash \n' \
|
||||
'qemu-system-x86_64 -enable-kvm --daemonize \' '\n' \
|
||||
'\t -cpu host \' '\n' \
|
||||
'\t -smp '$CORES' \' '\n' \
|
||||
'\t -drive format=raw,file='$DISK',if=virtio \' '\n' \
|
||||
'\t -m 4G \' '\n' \
|
||||
'\t -m '$RAM' \' '\n' \
|
||||
'\t -name '$NAME' \' '\n' \
|
||||
'\t -vga qxl \' '\n' \
|
||||
'\t -spice port='$PORT',disable-ticketing \' '\n' \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue