# Qemu

## Install

```
brew install qemu
```

## Cheat Sheet

```
# List available machines
qemu-system-x86_64 -machine help

# List available accelerators
qemu-system-x86_64 -accel help
```

## Create VM

### Create disk

```
qemu-img create -f qcow2 disk.qcow2 50G
```

### Intel Host -> x86\_64 guest

```
qemu-system-x86_64 \
  -machine type=q35,accel=hvf \
  -smp 2 \
  -hda disk.qcow2 \
  -cdrom ~/Downloads/Ubuntu.iso \
  -m 4G \
  -vga virtio \
  -usb \
  -device usb-tablet \
  -display default,show-cursor=on \
  -cpu host \
  -full-screen
```

### M1 Host ->x86\_64 guest

```
qemu-system-x86_64 \
  -machine type=q35,accel=tcg \
  -smp 2 \
  -hda disk.qcow2 \
  -cdrom ~/Downloads/Ubuntu.iso \
  -m 4G \
  -vga virtio \
  -usb \
  -device usb-tablet \
  -display default,show-cursor=on \
  -full-screen
```

### References

[https://www.arthurkoziel.com/qemu-ubuntu-20-04/](<https://www.arthurkoziel.com/qemu-ubuntu-20-04/&#xA;https://www.arthurkoziel.com/qemu-on-macos-big-sur/>)

[\
https://www.arthurkoziel.com/qemu-on-macos-big-sur/](<https://www.arthurkoziel.com/qemu-ubuntu-20-04/&#xA;https://www.arthurkoziel.com/qemu-on-macos-big-sur/>)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.devops.buzz/public/macos/qemu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
