-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-usb
22 lines (18 loc) · 949 Bytes
/
run-usb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
if [ $# -eq 0 ]; then
echo "============================================================================================="
echo "Script para ejecutar USB con QEMU y KVM (necesario tener instalados paquetes qemu y qemu-kvm)"
echo "============================================================================================="
echo "Si necesitas un disco duro virtual previo puedes crearlo con qemu-img. Por ejemplo: "
echo " qemu-img create -f qcow2 disco.img 20G"
echo
echo "Modo de uso: ";
echo " $0"
echo " $0 disco.img "
echo " En este segundo caso pulsar F12 en el inicio para seleccionar dispositivo de arranque."
echo "Pulsa una tecla para continuar ...";
read
fi
USB="sdb";
if [ $1 ]; then DISCO="-hda $1 -boot menu=on"; fi
sudo qemu-system-x86_64 $DISCO -enable-kvm -machine q35,accel=kvm -drive format=raw,file=/dev/$USB,cache=none,if=virtio -m 2048 -usb -device usb-tablet