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

Document How To run Quickemu on macOS hosts #248

Closed
kocierik opened this issue Nov 23, 2021 · 14 comments
Closed

Document How To run Quickemu on macOS hosts #248

kocierik opened this issue Nov 23, 2021 · 14 comments
Labels
duplicate This issue or pull request already exists

Comments

@kocierik
Copy link

Error when I create a vm

Quickemu output

uname: illegal option -- -
usage: uname [-amnprsv]
uname: illegal option -- -
usage: uname [-amnprsv]
uname: illegal option -- -
usage: uname [-amnprsv]
Quickemu 2.3.2 using /usr/local/opt/qemu-hvf/bin/qemu-system-x86_64 v6.0.50
 - Host:     Unknown OS running   ()
./quickemu: line 240: lscpu: command not found
./quickemu: line 241: lscpu: command not found
./quickemu: line 242: lscpu: command not found
 - CPU:
 - CPU VM:    Socket(s), 4 Core(s), 1 Thread(s)./quickemu: line 298: free: command not found
, 2G RAM
ERROR! EFI boot requested but no EFI firmware found.
       Please install OVMF firmware.

Run quickemu or quickget and paste the output here.

Usage
  quickemu --vm ubuntu.conf

You can also pass optional parameters
  --delete                : Delete the disk image.
  --display               : Select display backend. 'sdl' (default), 'gtk', 'none', or 'spice'
  --fullscreen            : Starts VM in full screen mode (Ctl+Alt+f to exit)
  --ignore-msrs-always    : Configure KVM to always ignore unhandled machine-specific registers
  --screen <screen>       : Use specified screen to determine the window size.
  --shortcut              : Create a desktop shortcut
  --snapshot apply <tag>  : Apply/restore a snapshot.
  --snapshot create <tag> : Create a snapshot.
  --snapshot delete <tag> : Delete a snapshot.
  --snapshot info         : Show disk/snapshot info.
  --status-quo            : Do not commit any changes to disk/snapshot.
  --version               : Print version

Linux Distribution & Kernel

Darwin Eriks-MacBook-Pro.local 20.6.0 Darwin Kernel Version 20.6.0: 
Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64
@daPhipz
Copy link
Member

daPhipz commented Nov 23, 2021

What were the exact commands that you used (1) to create the VM and (2) to launch it?
You only posted the output of those commands 😬

@kocierik
Copy link
Author

kocierik commented Nov 23, 2021

sorry! 😬

./quickget ubuntu-mate impish

Now I have the ubuntu iso downloaded!

@philclifford
Copy link
Contributor

Darwin Eriks-MacBook-Pro.local 20.6.0 Darwin Kernel Version 20.6.0: 
Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

Would that be MacOS Big Sur you are trying to run quickemu on by any chance ?

@kocierik
Copy link
Author

Yes

@flexiondotorg flexiondotorg changed the title Macos Big Sur error Add support for running Quickemu on macOS hosts Dec 3, 2021
@flexiondotorg flexiondotorg added the enhancement New feature or request label Dec 3, 2021
@flexiondotorg
Copy link
Member

Quickemu is currently only intended for use on Linux workstations. If anyone wants to help add support for running Quickemu on macOS hosts, we welcome PRs 👍

That said, all the requirements from running Quickemu are documented in the README and it seems many are not available on your macOS hosts @kocierik. So, perhaps start with getting the requirements satisfied and see if that improves things for you 🙂

@flexiondotorg flexiondotorg added the help wanted Extra attention is needed label Dec 3, 2021
@sebdanielsson
Copy link

Status of the dependencies:

Notes:

  • spicy/spice-gtk only supports macOS Big Sur as of 2021-12-11.
  • All of the other available dependencies is available for macOS Big Sur and Monterey on both Intel and Apple Silicon.
  • qemu (6.0.0 or newer) with GTK, SDL, SPICE & VirtFS support
  • bash (4.0 or newer)
  • coreutils
  • EDK II
  • grep
  • jq
  • LSB
  • procps
  • python3
  • macrecovery
  • mkisofs (cdrtools)
  • usbutils
  • util-linux
  • sed
  • spicy
  • swtpm
  • wget
  • xdg-user-dirs
  • xrandr
  • zsync

Homebrew:

brew install qemu bash coreutils grep jq [email protected] cdrtools gnu-sed spice-gtk wget zsync

@quickemu-project quickemu-project deleted a comment from daPhipz Feb 21, 2022
@flexiondotorg flexiondotorg changed the title Add support for running Quickemu on macOS hosts Document How To run Quickemu on macOS hosts Feb 21, 2022
@flexiondotorg flexiondotorg added documentation Improvements or additions to documentation good first issue Good for newcomers and removed enhancement New feature or request labels Feb 21, 2022
@flexiondotorg
Copy link
Member

@sebdanielsson Please consider submitting a pull request that adds documentation to the README for getting Quickemu working on macOS.

@trollkarlen
Copy link

trollkarlen commented Apr 6, 2022

lscpu is not included in the MacOS version of util-linux

@trollkarlen
Copy link

trollkarlen commented Apr 7, 2022

I did some basic work with changing all use other tools instead of:
lscpu => sysctl machdep.cpu
uname => guname
free => sysctl -n hw.memsize

It works for both platforms now to some extent.
The issue comes to the qemu flags for various display modes and spice devices, its above my paygrade to get that to work properly. I just commented out everything from the .sh file generated that qemu complained about(gl, and spice devices mostly) and it started but have not done any further tests.
If any body wants it(Can continue the work on the qemu flags) i can push it to some temporary branch.

@trollkarlen
Copy link

trollkarlen commented Apr 7, 2022

It now works with MacOS host and ubuntu guest. If someone have the means to test it out.
Both so i did not break any old hosts and that other guests works on MacOS(They should :)).
Here is the fork, say when and ill create a pull request.
https://github.com/trollkarlen/quickemu

@pythoninthegrass
Copy link

@trollkarlen I ran a diff on 3.16 vs. your fork (3.14?) and manually patched the current rev. This is the output for EndeavourOS on an M1 Pro running macOS 12.4:

λ quickemu --vm endeavouros-apollo_22_1.conf
ERROR! Public directory: '' doesn't exist!

λ quickemu --vm endeavouros-apollo_22_1.conf --public-dir ~/Downloads
uname: illegal option -- -
usage: uname [-amnprsv]
uname: illegal option -- -
usage: uname [-amnprsv]
uname: illegal option -- -
usage: uname [-amnprsv]
Quickemu 3.16 using /opt/homebrew/bin/qemu-system-x86_64 v7.0.0
 - Host:     Unknown OS running   ()
/usr/local/bin/quickemu: line 254: lscpu: command not found
/usr/local/bin/quickemu: line 255: lscpu: command not found
/usr/local/bin/quickemu: line 256: lscpu: command not found
 - CPU:
 - CPU VM:    Socket(s), 4 Core(s), 1 Thread(s)/usr/local/bin/quickemu: line 312: free: command not found
, 2G RAM
ERROR! EFI boot requested but no EFI firmware found.
       Please install OVMF firmware.

λ quickemu --vm endeavouros-apollo_22_1.conf --public-dir ~/Downloads
ERROR! Requested sdl display, but only cocoa avalible on MacOS.

λ quickemu --vm endeavouros-apollo_22_1.conf --display cocoa --public-dir ~/Downloads
Quickemu 3.16 using /opt/homebrew/bin/qemu-system-x86_64 v7.0.0
 - Host:     Unknown OS running Darwin 21.5 (mbp)
sysctl: unknown oid 'machdep.cpu.vendor'
 - CPU:      AppleM1Pro
 - CPU VM:   1 Socket(s), 4 Core(s), 1 Thread(s), 8G RAM
 - BOOT:     EFI (Linux), OVMF (/opt/homebrew/opt/qemu/share/qemu/edk2-x86_64-code.fd), SecureBoot (off).
 - Disk:     endeavouros-apollo_22_1/disk.qcow2 (16G)
             Just created, booting from endeavouros-apollo_22_1/EndeavourOS_Apollo_22_1.iso
 - Boot ISO: endeavouros-apollo_22_1/EndeavourOS_Apollo_22_1.iso
 - Display:  COCOA, virtio-vga, GL (off), VirGL (??)
 - ssh:      On host:  ssh user@localhost -p 22220
 - SPICE:    On host:  spicy --title "endeavouros-apollo_22_1" --port 5930 --spice-shared-dir /Users/lance/Downloads
 - WebDAV:   On guest: dav://localhost:9843/
 - 9P:       On guest: sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 Public-lance ~/Downloads
 - smbd:     On guest: smb://10.0.2.4/qemu
 - Monitor:  On host:  nc -U "endeavouros-apollo_22_1/endeavouros-apollo_22_1-monitor.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:endeavouros-apollo_22_1/endeavouros-apollo_22_1-monitor.socket
 - Serial:   On host:  nc -U "endeavouros-apollo_22_1/endeavouros-apollo_22_1-serial.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:endeavouros-apollo_22_1/endeavouros-apollo_22_1-serial.socket
qemu-system-x86_64: -accel hvf: invalid accelerator hvf
cat: endeavouros-apollo_22_1/endeavouros-apollo_22_1.pid: No such file or directory
 - Process:  Starting endeavouros-apollo_22_1.conf as endeavouros-apollo_22_1 ()
---
cat: endeavouros-apollo_22_1/endeavouros-apollo_22_1.pid: No such file or directory
 - Process:  Starting endeavouros-apollo_22_1.conf as endeavouros-apollo_22_1 ()

@ylluminate
Copy link

ylluminate commented Aug 17, 2022

Would very much like to see this progressed. @trollkarlen / @pythoninthegrass have either of you considered making a PR to integrate things into the current master branch to get some forward movement on this project?

I've been having some rough times with UTM.app - particularly in creating reliably recreatable virtual machines. It would be incredibly helpful to have a system such as this that utilizes QEMU on macOS to work with various and many operating systems and distributions.

For example, I'm using an Apple Silicon process and recently have had a usecase where I need to use the Intel x86 (32-bit) version of Debian to troubleshoot something. UTM seems to gag every time so far during first boot following setup and it really seems as though this project could facilitate working through such scenarios much more efficiently.

Having QuickEMU at our disposal, as I'm sure you guys can also see value in, would be of incredible value.

In reviewing the list above by @sebdanielsson I noted that the following may be available and/or worked around:

@flexiondotorg
Copy link
Member

This is not as simple as documenting usage, it requires Quickemu to add macOS host support which is being tracked in #447

@flexiondotorg flexiondotorg added duplicate This issue or pull request already exists and removed documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed labels Aug 18, 2022
@ylluminate
Copy link

@flexiondotorg I think the point, in my mind, with this discussion is to isolate all issues that may be resolvable prior to making PRs that make direct changes to quickemu... Maybe that's not the case?

I suppose there could be considerations in various elements of quickemu that should be altered to reduce/remove dependencies?

An example, LSB is something that would require a direct intervention in terms of changing filesystem locations for macOS tooling, etc. Right?

Similarly xdg would simply require replacement with macOS specific options, right? Unless one would want to, for some reason, utilize xquartz to provide this for X11 handling (which probably still could and should be done through open or some other function so that it's using macOS facilities).

Etc...

@quickemu-project quickemu-project deleted a comment from github-actions bot May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

8 participants