qemu.md (543B)
1 # qemu 2 3 ## create vm 4 ``` 5 qemu-img create -f qcow2 <filename> 4g 6 ``` 7 - `create [-f FMT] filename [size]` 8 - size is disk image size in bytes 9 10 ## install system 11 ``` 12 qemu-system-x86_64 -m 1g -cdrom /path/to/iso -boot order=d -drive file=<filename>,format=qcow2 13 ``` 14 15 ## start system 16 ``` 17 qemu-system-x86_64 <filename> 18 ``` 19 20 ## ssh 21 * start system with port 22 ``` 23 qemu-system-x86_64 <filename> -nic user,hostfwd=tcp::8888-:22 24 ``` 25 * from host 26 ``` 27 ssh <user>@127.0.0.1 -p 8888 28 ``` 29 * from guest 30 ``` 31 ssh <user>@192.168.0.3 # or whatever the local ip is 32 ```