Qemu Ubuntu For Mac

You should also specify a boot drive when launching the vm. Running qemu-system-x8664 -help on my machine yields this regarding the boot order:-boot order=drives,once=drives,menu=on off ,splash=spname,splash-time=sptime,reboot-timeout=rbtime,strict=on off 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n) 'spname': the file's name that would be passed to bios as. Mkdir /vms && cd /vms qemu-img create -f qcow2 ubuntu.qcow2 50g Download the Ubuntu Server 20.04 Install Image and my libvirt XML template and place the.iso and.xml files in the same folder.

For Ubuntu, Debian, Mint, and PopOS: sudo apt-get install qemu-system qemu-utils python3 python3-pip; For Arch and Arch based distros: sudo pacman -S qemu python python-pip; For Void: sudo xbps-install -Su qemu python3 python3-pip; For openSUSE Tumbleweed: sudo zypper in qemu-tools qemu-kvm qemu-x86 qemu-audio-pa python3-pip. Running 64- and 32-bit RISC-V Linux on QEMU¶ This is a “hello world” example of booting Linux on RISC-V QEMU. This guide covers some basic steps to get Linux running on RISC-V. It is recomended that if you are interested in a specific distrubution you follow their steps. STEP 2) Install QEMU. Under CentOS 7 you can just install couple of packets – that’s all you need: yum install -y qemu qemu-common qemu-img qemu-kvm-common qemu-system-x86 qemu-user bridge-utils Or under Ubuntu. Apt-get install qemu-kvm bridge-utils STEP 3) Prepare the network 1 – the bridge device.

Do you want to install macOS on Linux using Virtual Machine? The Sosumi could be an easy option, though there is no 100 percent guarantee it will work.

Mac
What is Sosumi?

What is Sosumi?

To install macOS on Linux using Qemu virtual machine, the developer Alan Pope (popey) has created a bundled snap package known as Sosumi. It is easy to install and works on Ubuntu, Fedora, Debian, and other major Linux distributions. Here is the Github page and source of this snap package. Or directly visit the Snap page of Sosumi.

After the installation of the Sosumi packages, the Clover bootloader will pop up and boot to the macOS recovery system. One thing that we need to note down is the Sosumi itself doesn’t contain macOS instead when we fire up snap packages based macOS-Simple-KVM virtual machine to install macOS Catalina desktop it downloads an installer image for the same.

The VM created by this snap package will have a fixed resolution window, initial launch with 2GB of memory, bundles qemu-virgil, which includes virtio-vga, a paravirtual 3D graphics driver.

I tried to use it on Ubuntu 18.04 LTS and faced a couple of issues. Let me take you through the steps of macOS installation on Linux using Sosumi and in between, I will discuss what problems I have faced; And why finally I gave it up.

If you are using Ubuntu or Linux Mint’s latest operating system version then SNAP will be by default installed on your system and you can simply run the following installation command. But for other supported Linux systems you need to install the SNAPD, the steps can be found here in the SNAP installation documentation.

To start or initialize it after the installation, simply type:

in the command terminal.



But after installing the above stable package of the Sosumi and later initializing it, I continuously got an error couldn’t connect to KVM, although everything was working fine and tried all the rings and whistles but couldn’t take it forward. Later, I removed the stable package and installed the developer one using the below command:

Yes, this time it did work and connected the KVM successfully but again with one more error.

So, I enable the xhost access control program by the following commands:

Once, it done, ran again sosumi command and this time I successfully able to start the process, first it downloaded the macOS installer image and then it triggered the Qemu machine with the Clover interface to install macOS on it.

Downloading macOS Catalina base system for Virtual machine

Few things which we should keep in mind before moving further to install macOS on Linux virtual machine.

  1. CPU should support hardware virtualization.
  2. Once up and running the VM could use more than 30 GB of storage on the physical hard drive, thus make sure you have enough space. You can check your Sosumi folder size at ~/snap/sosumi
  3. The script of Sosumi will automatically assign Virtual RAM, storage, CPU and other Virtual resources to macOS, if you want to customize that, it can be done in ~/snap/sosumi/common/launch
  4. The running of macOS could be slow.
  5. Even after spending hours, installing and setting up the macOS Catalina on Linux Qemu via this SNAP package, there is no surety it will work. Thus, this is just for experiment and incase it work fine, voilà enjoy it.

Clover Bootloader on Sosumi VM

If everything goes well soon you will see Clover bootloader, simply press the Enter button to start booting macOS.

Note: To release the mouse pointer or take out and to focus it on host operating system press CTRL + Alt + G simultaneously.

Sosumi Clover Qemu

macOS Utilities

If you are a user of macOS then you already know what to do next, however, if not then first we create a Disk partition to install on macOS on Linux VM. Select the Disk Utility option.

Apple Disk Partition

Select the first partition created by the Sosumi script which will be of 68.72 GB, enough to start with. Now, click on Erase button given in the top menu.

Format Disk in mas OS Extended (Journaled)

Qemu Kvm Mac

Simply give a name to the disk while leaving the rest of the options as it is, click on the Erase button.

Erase and name the partition

Once done close the Disk Utility and get back to the macOS Utilities screen.

Reinstall macOS

As here we are showing the system that we are not installing macOS from zero instead assume there is some problem and we want to reinstall a new copy of macOS, that’s why we have the “Reinstall macOS” option, so just select that and hit the Continue button.

Re-install macOS

Click the Agree button.

Select the Disk

Qemu Mac Os 9

The disk we have created above will show in this step, select that and hit the Install button to get the macOS on Linux Virtual Machine.

Select Hard drive

So, now if everything goes well it will install in around 50 minutes and if not then even I don’t know how much time it would take because in my case, first, it showed 23 minutes than 11 hours.

It was kind of stuck here. I even went through the developer page of Sosumi but didn’t find any relevant way to solve this problem, thus in my case I was not able to install it. I know running macOS on hardware and environment which is not meant for it is always a cumbersome job.

So, this was my predicament, however, if you have some time and want to experiment with it you can try Sosumi on your machine may be it work fine in your case. Nevertheless, I will also try the source of this snap package VM that is macOS-Simple-KVM, a set of tools to set up a quick macOS VM on QEMU, accelerated by KVM and will let you know my experience with it. Till then be safe and keep experimenting with Linux.

This howto rather continues the previous one “Howto do QEMU full virtualization with MacVTap networking” with the exception it will be showed how to use a classic setup of the networking – the use of bridge device. Because this setup requires specific configuration for every linux distro if we do not just add the bridge manually it is separated in this howto. For the clear and full howto we would repeat the two first steps just to enable this howto to be independent from the original one mentioned above.
So use full virtualization under linux you can use QEMU and no other library or manager like virt-manager. QEMU is simple enough and with couple of parameters to it you can start KVM virtual machines with near native performance. To use KVM you must enable it in the BIOS of your server (or desktop machine).

Here are the main steps:

STEP 1) Enable KVM in the BIOS

  • For Intel machine you must find option Intel Virtualization Technology (or Intel VT-x) probably in BIOS menu of Chipset, Advanced CPU Configuration or other.
  • For AMD machine the virtualization cannot be disabled so it is enabled by default, but you can check for additional virtualization features to enable like Virtualization Extensions, Vanderpool and other.
  • Enable also additional features – Intel VT-d or AMD IOMMU, if they are available.

Reboot your machine and check if the KVM is supported:

STEP 2) Install QEMU

Under CentOS 7 you can just install couple of packets – that’s all you need:

Or under Ubuntu

Qemu

STEP 3) Prepare the network 1 – the bridge device

Mac

Under CentOS 7 add the following configuration file

/etc/sysconfig/network-scripts/ifcfg-br0

with the content of

If you want to use real IP set to your virtual machine, you should set a real IP here and uncomment the GATEWAY0 with the real gateway IP. If real IP is used then you should include the main Internet network interface to the bridge with adding at the end of the configuration file /etc/sysconfig/network-scripts/ifcfg-eth0 (if eth0 is your network interface):

And restart the network

Under Ubuntu add to the file

/etc/network/interfaces

the following:

If you want to use real IP set to your virtual machine, you should set a real IP here and uncomment the GATEWAY0 with the real gateway IP and replace the “none” in the option “bridge_ports” with the name of your main Internet network interface. For example:

And restart the network

Or we can add the bridge device manually:

If we use real IP we have to add the main Internet network interface to the bridge, so when you set up the network in our virtual machine with a real IP it will work with no more additional configurations, but if we use a local IPs like our setup here and we want to have Internet in our virtual machine we must enable masquerade and linux routing. You can do it with:

Use either firewalld or iptables setup, depends on your system configuration, just check if firewalld is running with:

If you receive an error, saying command not found or firewalld is not running, you should use the “NAT with iptables”
So the network is ready!

STEP 4) Prepare the network 2 – the tun/tap for the virtual machine

After we have added a bridge device tun/tap device, which will be used for the QEMU virtual machine must be added:

Qemu On Mac Os

STEP 5) Create a QEMU hard drive

Create a 100G file

or you can enable encryption (but on every start of your virtual machine you must set the key through the qemu console to start the virtual machine):

STEP 6) Boot up the QEMU KVM virtual server

The command above will :

  • “-enable-kvm” – enable the KVM – full virtualization with near native performance
  • “-cpu host” – will expose all supported host CPU features (only supported in KVM mode)
  • “-smp 4” – sets 4 processors to the virtual machine
  • “-daemonize” – start the command in daemon mode
  • “-runas qemu” – run under user, you can run thwo whole virtual machine from a user created especially for it, no need to run it with root, even it is recommended to run it under unprivileged user
  • “-vnc 192.168.1.10:1” – start a VNC server on this IP:PORT = 192.168.1.10:5901, the IP must present on the server or you can use 0.0.0.0:1 for 0.0.0.0:5901, but in every situation limit the access by a firewall
  • “-drive file=/mnt/storage1/disks/vm_harddisk.qcow2,index=0,cache=none,aio=threads,if=virtio” – set the main hard drive of the system
  • “-boot d” – boot from the first hard drive
  • “-net nic,model=virtio,macaddr=00:00:00:00:00:01 -net tap,ifname=tap0” – set the network interface using the tap device created by STEP 3) and STEP 4)
  • “-balloon virtio” – use balloon driver to be able to hot add or hot remove RAM
  • “-m 2048” – set virtual RAM size to megs
  • “-monitor telnet:127.0.0.1:5801,server,nowait” – set the management console for the this virtual server, you can connect with:

    When quitting the management console you must NOT exit the console with quite/exit or CTRL+d, becuause it will terminate the virtual server, you must disconnect from the console with “CTRL+]” and then quit the telnet shell. With the console you can hot add/remove CPU, RAM, network cards, pci devices, harddrives, start/stop/shutdown/reset the virtual machine and a lot more.

Boot the virtual machine from the hard drive given by “-drive” with network “-net” (couple of options), the RAM uses baloon memory and could be adjusted on-the-fly and sets the vncserver to listen for connection on port IP:port = 192.168.1.1:5901 (probably you’ll want to change this with a the real IP of your server, but be careful to set up a firewall rule for 5901 – the vnc port) and a management console listening on IP:port 127.0.0.1:5801.

* Boot the virtual server from a virtual CD/DVD

Qemu Ubuntu For Mac

Probably the first time booting you might need to boot from an installation disk, this could be done by the following command:

Run Mac Os On Qemu

The changes:

Qemu Gui Mac

  1. “-boot c” – First boot device is now CD/DVD. “c” is for CD, “d” is for disk
  2. “-cdrom /mnt/storage1/disks/isos/CentOS-7-x86_64-NetInstall-1708.iso” – added the installation disk to the virtual machine