In Developer world , we often need to switch between multiple OS . It doesn’t matter what may be the reason for switching , we need access to all major platforms like Linux , Mac and Windows .
But for an obvious reason , we cannot afford to have machines equipped with mac, windows and Linux all the time .
So , the second option to get all platforms without leaving your existing one is Running Virtual machines . But getting and ISO file of mac OS and setting up a VM is a tough task in itself .
If you are an iOS developer or desire to be one , this path is not for you . You better get a mac book or a mac Mini if you are tight on budget . But if your day job is not developing for iOS and mac OS but something like developing cross platform applications with React Native or Flutter or say JAVA then it becomes handy if you can test or develop on the target platform .
And here comes Sosumi to Rescue . Sosumi is a snap application that gets the mac OS image , builds virtual machines and gives US a relatively easy way to get access to mac OS VM . And it is usable for development and testing purposes . ( you can edit videos too if you have access to powerful hardware ) .
Contents
Prerequisites
- Multi Core Intel or AMD CPU with Virtualization Enabled
- Enough ram and storage ( more is better , SSD recommended , minimum 4 GB ram and 60 GB free storage )
- Linux distro with snap support
- Active Internet Connection ( 10-15 GB Data needed )
- Free Time ( 1-2 Hrs depending on your machine specs )
For this experiment I am using , Intel Core i5 10 th generation (4C/8T) , 8 GB 3200 MHz DDR4 RAM and 512 GB PCIe SSD on Pop OS 20.04
Steps :
- Install sosumi
- configure VM storage , memory and CPU
- Launch VM
- Install Mac OS
- Setup USB device pass through for Web Cam and Flash drive
Let’s get started ! 😎
Install Sosumi
sosumi is snap application available on snap store . It utilizes QEMU / KVM technology and creates Mac OS virtual .
We will install sosumi with CLI .
After app installation , launch the sosumi it will download required files . Wait for the process to finish .
Configure sosumi
For configuring VM we need to edit launch file located in /home/USER/snap/sosumi/common .
Open launch file using your preferred text editor and make changes to it .
These are launch file default contents. focus on line number 7 and line number 9 . in line 7 , memory is assigned to VM and in line 9 CPU count is given .
change the lines starting with -m for memory .By default 2 GB ram is dedicated to vm and 2 CPU cores used . I’ll give it 4 GB ram and 4 cores so that it will run smoothly . You can give more if available to you .
After changes , it looks like .
lets change , the size of the virtual disk image . By default its 60 GB but for development purpose many time 60 GB is not enough . So we will resize it . Use qemu-img utility to resize it . Here +10G indicates increase in 10 GB size . I have already increased it by 20 and adding 10 more , making it a 100 GB Virtual disk .
Required Configuration is Done ! Lets launch Sosumi app now .
Installing Mac OS
After booting VM , you will see this menu . Select Disk Utility to format the virtual hard disk and make ready for mac OS installation .
Here click on Erase button and without changing any option , erase the disk . give a name of your choice to drive . Here , I have given macDisk.
Disk is now ready to install mac OS . Exit the Disk utility and proceed.
Now , click on Reinstall mac OS and proceed .
Now , Installation begins and it will take the maximum chunk of time . make sure you have stable internet connection and put your machine to performance mode .
Accept the license agreement and proceed.
Now , select our formatted disk to install the OS .
Now , sit back and relax ☕ . It will take some time to complete the installation .
After finishing installation , you will see another entry in clover boot loader screen . Select the one with our disk name in it .
It will take some more time and reboot multiple time until it finishes. finally when you see screen like this consider it to be done . Now select Boot mac OS from mac Disk ( or select the disk with name you given ) .
Now , mac OS is ready but we need some more steps until its usable . Here lets configure our Geographical location .
Now , select the desired language support . Here I am keeping it default .
Click continue to proceed.
Here you have to select Don’t transfer any information . As we are in VM , its isolated environment and will not be able to connect directly to outside devices .
If you have existing Apple ID , login with it or click Set Up later for offline account .
Lets create a user account in this step . ( Note : always give a strong password . I am giving weak one for demo only )
Click continue to proceed.
If you are a fan of virtual assistants keep Siri enabled . But I am turning it off . Click continue to proceed.
Select theme of your choice . I am going with Dark for now .
And here you go . Your mac OS VM is ready to use. Now power off the machine . We have some configurations to do .
Configuring Sosumi for USB pass through
USB pass through enables VM to access USB device inside the VM .
First of all lets list down all the USB devices connected . use lsusb command .
Sosumi being a snap application , has some connections / interfaces . As its a sand boxed application format , we need to enable USB access to sosumi first .
As you can see sosumi: raw-usb is off. Lets enable it .
Now , USB access to sosumi is enabled . We need to add usb device to launch file and change permission of USB device file . Here I have added device Web cam in launch file ( see last line ) . We need to give vendor id and product id in hex format .
Now , for changing USB device permission use chmod a+w command and location of the usb device file .
Launch sosumi and check Webcam access . Its working .
Now lets repeat the process for San disk Pen drive . list the USB devices , add to launch file and give permission .
Conclusion
Now we have working Mac OS Virtual machine without leaving Linux environment . You can use it to develop and test your cross platform applications .