-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvm.sh
More file actions
executable file
·49 lines (45 loc) · 1.03 KB
/
vm.sh
File metadata and controls
executable file
·49 lines (45 loc) · 1.03 KB
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
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
function start_win7()
{
kvm -smp 2 -m 1300 -drive file=/media/multimedia/vm/win7/win7.qcow2,cache=writeback -usbdevice tablet #-net nic,model=virtio -net tap,ifname=tap0,script=no
}
function start_debian()
{
kvm -smp 2 -m 1300 -drive file=/media/multimedia/vm/debian/debian.img,cache=writeback -net nic,model=virtio -net tap,ifname=tap0,script=no -usbdevice tablet
}
function start_centos()
{
kvm -smp 2 -m 512 -drive file=/media/extdata/kvm/centos/centos.qcow2,cache=writeback -net nic,model=virtio -net tap,ifname=tap0,script=no -usbdevice tablet
}
function start_freebsd()
{
kvm -smp 2 -m 512 -drive file=/media/extdata/kvm/freebsd/freebsd.qcow2,cache=writeback -net nic,model=virtio -net tap,ifname=tap0,script=no -usbdevice tablet
}
while getopts 's:' OPT
do
case $OPT in
s)
sys=$OPTARG;
;;
*)
echo "Usage: vm.sh -s {win7|debian}"
;;
esac
done
case $sys in
win7)
start_win7 &
;;
debian)
start_debian &
;;
centos)
start_centos &
;;
freebsd)
start_freebsd &
;;
*)
echo "Unkown system $sys"
;;
esac