Tuesday 23 February 2021

Running Windows Apps on Apple Mac M1 with Crossover

Another approach to running Windows apps on Mac M1 with ARM architecture is to use Crossover, which is based on the venerable WINE (Windows Emulator) application. This emulates the Windows system call interface and so runs applications directly on the Mac rather than through a VM like Parallels.

To try it out I did

1. Download Crossover for Mac ARM and install it
https://www.codeweavers.com/crossover/download

2. Run Crossover. You can use it free for 14 days as a trial version. It's inexpensive compared to Windows and Parallels licences.

3. Click Install a Windows Application.
In the search box type "Steam".
Click it from the list. 
Click Continue.
On the Select Bottle tab choose Windows 10  64-bit Bottle. Click Continue.
Go through various Windows software installation screens clicking continue.
You now have a Windows 10 Bottle called "Steam" containing Steam app.

4. Click Install a Windows Application.
Type "DXVK". Select it from the list and install to the "Steam" bottle.

5. Click Install a Windows Application.
Select application DirectX for Modern Game and install to the "Steam" bottle.

6. In Crossover, right Click Steam App / Settings  DXVK Backend for D3D11 and save it.


7. Click the Steam icon to run it. Login and try out a Windows Steam game.  That worked for me.

Here is a YouTube video I followed to get started https://www.youtube.com/watch?v=3TdCV7fn2CA


Run Windows 10 ARM preview on Mac M1

1. Download and install the Parallels desktop beta for Mac M1 ARM architecture 
https://www.parallels.com/directdownload/pdbeta

2. Sign up for Microsoft Insider Program https://insider.windows.com/en-us/en-gb 
to get access to download their Windows 10 on ARM preview release
https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewARM64

3. Run Parallels and create a new VM from the ISO.

There's a video on YouTube I followed https://www.youtube.com/watch?v=A0qNgThYLkw

I've tried it out and it seems to work well. Steam glitched a bit on the main window (the small view worked fine) and I was able to play a couple of games from my library.




Run a vagrant virtual machine Fedora 33 for ARM on Mac M1 under Parallels virtualisation beta

I managed to build and run a vagrant Fedora VM box on Mac M1 ARM architecture using the Parallels virtualisation beta and packer to build the vagrant box.

Full details and packer source code at https://github.com/peterdragon/packer-M1-parallels-fedora33






Setting up homebrew on Apple Mac M1 with ARM architecture

Homebrew https://brew.sh/ lets you install and manage packages and applications from the command line on MacOS.

The new Apple Mac M1 is running Apple Silicon technology which is based on ARM processor (aarch64 architecture) rather than Intel processor (x86_64 architecture). This can cause some issues when wanting to run software compiled for x86_64 when a version is not available yet on aarch64.

To work around this, Apple provide Rosetta which provides an emulation layer to execute x86 opcodes under ARM. You can install Rosetta from terminal with

$ /usr/sbin/softwareupdate --install-rosetta --agree-to-license

To make it simpler to switch between ARM and x86 mode copy set up a new terminal profile which will run under Rosetta emulation.

Run terminal, press Apple + , to open Preferences. Click on your favourite profile, e.g. mine is called "a Homebrew".


Click the three dot icon at the bottom and on the popup menu click Duplicate Profile. 


Enter a name like "Rosetta Shell" and click on the tab Shell then tick Run command and enter 

env /usr/bin/arch -x86_64 /bin/bash --login


Now if you run terminal using your usual profile it will give you a terminal session running in ARM mode.
If you click menu Shell / New Tab then you should see a list of profiles. Click on the Rosetta Shell one you created.


You should have two tabs open. The first is your ARM mode shell. The second is your Rosetta x86 mode shell.

You can click between them to run commands now for either mode.

We'll install Home brew for both ARM and x86.
For ARM mode it will go in the default location /opt/homebrew.
For x86 mode it will go in /usr/local.

In the first tab, type 

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

It will install ARM brew to /opt/homebrew/bin/brew.

In the second tab, type the same command.
It will install x86 brew to /usr/local/bin/brew.

Finally I add some lines to my shell startup profile ~/.bash_profile to detect which mode I am running in and to set the correct path to brew. I also change the prompt so that I get an i when in Intel x86 mode.
Edit ~/.bash_profile and add

if [ "$(sysctl -n sysctl.proc_translated)" = "1" ]; then
    # run under rosetta 2 with
    #   env /usr/bin/arch -x86_64 /bin/bash --login
    #local brew_path="/usr/local/homebrew/bin"
    eval $(/usr/local/bin/brew shellenv)
    export PS1="i \D{%I:%M %p}:\w $ "
else
    #local brew_path="/opt/homebrew/bin"
    eval $(/opt/homebrew/bin/brew shellenv)
    export PS1=" \D{%I:%M %p}:\w $ "
fi

Now when I logout of terminal and back in I see either the ARM prompt

or the x86 prompt with an i to remind me of the mode

Note that I am using bash for my Apple shell. The system default is now zsh so you will need to adapt this if you use that.


Not all packages are available yet under ARM brew.
However, the full range is available under x86 brew running under the Rosetta x86 emulation.

E.g. $ brew install ruby



Tuesday 3 May 2011

3 things I'd change in Perl 5

I replied to Ovid's question on blogs.perl.org about what three things you would change in Perl 5 language:
In summary, proper OO support, better deployment and making perl5 parsable without using the perl5 compiler that is written in C and makes it hard to virtualise perl support in a sandbox.

Regards, Peter

Monday 21 September 2009

Eee BIOS upgrade

I was getting occasional errors from my RunCore SSD where the partition when read only and would not write and I needed to update my Eee PC 1000 BIOS.
This is a bit trickier than you might think as you need a FAT-16 formatted USB stick of less than 2GB, otherwise the Eee updater gives you error messages saying it cannot read 1000.ROM or that it is in the wrong format.
Anyway, to save time for anyone else who is searching how to do this, see http://wiki.eeeuser.com/howto:updatebios.
From Windows, you can right click a mounted USB and choose Format / FAT to get the correct FAT-16 format, then download the latest Eee 1000 BIOS .ZIP file from the Asus site (mine was 1000-ASUS-1003.zip), unzip it and rename the 1000-asus-1003.rom file to 1000.ROM before copying to the USB stick. Put it in your Eee then power on with ALT-F2 held down, making sure you are running on mains power and have a fully charged battery. It takes about 5 minutes to flash update the BIOS ROM.

Sunday 16 August 2009

Make your Asus Eee 900/1000 run 4x faster

Previously, I described how to set up an Asus Eee 1000 to run Eeebuntu and described the 8GB / 32GB Solid State Disk setup it has. What I didn't realise then is that the 32GB SSD provided was much slower than the 8GB SSD, and that the 8GB SSD wasn't particularly fast either.

You can now purchase a much faster "Runcore" drop-in replacement for the 32GB SSD.
It is 4-6x faster for read/write and makes apps that were sluggish before, such as Firefox, respond quickly. Boot and shutdown time and noticeably faster too.

The Runcore is sized at either 64GB or 128GB. I went for the 64GB option (enough for me!)
The full title for Googling is RunCore 64GB PATA Mini PCI-e PCIe SSD for ASUS EEE PC 901 and 1000. Phew.
In the US you can buy it from mydigitaldiscount.com ($220) and in the UK I bought mine from memoryc.com for £160 inc. VAT. Check out the comments on there from other happy customers :-)

Installation is simple. Backup all your data to a USB stick (usual warnings about proceeding at your own risk). Shutdown and unplug your Eee PC. Turn it over. On the back there is a panel (red rectangle below) retained by two precision screws (red circles). One of these on mine was hidden under a silver "EeePC" sticker which I had to peel up for access.


Unscrew these using the (provided) precision screwdriver and lift off the panel. You can then remove two screws to release the existing 32GB memory card. It is simple to push in the replacement one and screw it down. Replace the panel and screw that down. Here's my old Asus 32GB card in the box the RunCore card came in from memoryc.com:

Now power back up and on the BIOS boot screen press F2. Go to Advanced, IDE Configuration and you should see [RunCore 64G-C SSD] as the new drive.

What I did was install Eeebuntu 3.0.1 (Ubuntu 9.04) to the 64GB RunCore SSD (format it and use 100% of space for root / partition) and use the Asus 8GB SSD as the Linux swap space (select manual configuration at install time to be able to do this). After that I restored my user files from the backup.

Works like a charm!