-
Notifications
You must be signed in to change notification settings - Fork 0
/
startvm-2
executable file
·38 lines (35 loc) · 1.22 KB
/
startvm-2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
#exec qemu-system-x86_64 -enable-kvm \
# -cpu host \
# -m 512M \
# -drive file=ArchVM-2.img,if=virtio \
# -netdev user,id=vmnic,hostname=archvm2 \
# -device virtio-net,netdev=vmnic,mac="72:49:ef:dc:e4:02" \
# -name "Arch VM 2" \
# "$@"
#USERID=$(whoami)
#precreationg=$(ip tuntap list | /usr/bin/cut -d: -f1 | /usr/bin/sort)
#sudo ip tuntap add user $USERID mode tap
#postcreation=$(ip tuntap list | /usr/bin/cut -d: -f1 | /usr/bin/sort)
#IFACE=$(comm -13 <(echo "$precreationg") <(echo "$postcreation"))
#
#macaddr='72:49:ef:dc:e4:02'
#
#echo $IFACE
#
#qemu-system-x86_64 -enable-kvm \
# -cpu host \
# -m 512M \
# -drive file=ArchVM-2.img \
# -net nic,macaddr=$macaddr -net tap,ifname="$IFACE" \
# $*
sudo qemu-system-x86_64 -enable-kvm \
-name "Arch VM 2" \
-cpu host \
-m 512 -smp 4 \
-hda ArchVM-2.img \
-chardev socket,id=char2,path=/usr/local/var/run/openvswitch/vhost-user2 \
-netdev type=vhost-user,id=mynet2,chardev=char2,vhostforce \
-device virtio-net-pci,mac=00:00:00:00:00:02,netdev=mynet2 \
-object memory-backend-file,id=mem2,size=512M,mem-path=/dev/hugepages,share=on \
-numa node,memdev=mem2 -mem-prealloc