Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start VM with QEMU #1

Open
2 tasks
shinohara-rin opened this issue Mar 12, 2024 · 3 comments
Open
2 tasks

Start VM with QEMU #1

shinohara-rin opened this issue Mar 12, 2024 · 3 comments
Assignees

Comments

@shinohara-rin
Copy link
Member

shinohara-rin commented Mar 12, 2024

  • amd64
  • aarch64
    - [ ] i386
    - [ ] riscv64
@shinohara-rin shinohara-rin self-assigned this Mar 12, 2024
@cocoa-xu
Copy link
Member

I tested the following commands to start aarch64 FreeBSD

qemu-system-aarch64 \
  -M virt,gic-version=3 \
  -cpu cortex-a72 \
  -smp 4 \
  -bios edk2-aarch64-code.fd \
  -m 3072 \
  -nographic \
  -drive if=none,file=FreeBSD-14.0-RELEASE-arm64-aarch64.qcow2,id=drv,format=qcow2 \
  -device virtio-blk-pci,drive=drv \
  -device virtio-net-pci,netdev=net0 \
  -netdev user,id=net0,hostfwd=tcp:127.0.0.1:2234-:22 \
  -device virtio-rng-pci

@cocoa-xu
Copy link
Member

We should allow users to change the value of smp and m, which is the number of cores and memory size in the vm. And by default we can set smp to the number of cores available on the host machine, and 3072 (MB) as the memory size.

@cocoa-xu
Copy link
Member

For x86_64 and i386 VMs, we can use the following commands, (using x86_64 FreeBSD image as example)

qemu-system-x86_64 \
  -M pc \
  -cpu cortex-a72 \
  -smp 4 \
  -bios /usr/share/qemu/OVMF.fd \
  -m 3072 \
  -nographic \
  -drive if=none,file=FreeBSD-14.0-RELEASE-amd64.qcow2,id=drv,format=qcow2 \
  -device virtio-blk-pci,drive=drv \
  -device virtio-net-pci,netdev=net0 \
  -netdev user,id=net0,hostfwd=tcp:127.0.0.1:2234-:22 \
  -device virtio-rng-pci

@cocoa-xu cocoa-xu self-assigned this Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants