Showing posts with label Mac OS X. Show all posts
Showing posts with label Mac OS X. Show all posts

27 December 2020

Intel x86_64 Windows (not Arm Windows) successfully runs on Apple Silicon M1 MacBook Air - how to

Some articles started to report about Arm Windows running on Apple Silicon Mac, but Arm Windows is not major in industry yet.

I thought a different story.

The macOS itself provides Virtualization Framework to execute Linux virtual machine guest OS easily on macOS, and it is the same on Apple Silicon
Therefore Apple Silicon Mac can execute Arm Linux guest OS.
Linux OS provides QEMU virtualization that can use both KVM (hardware-based kernel virtualization) and software-based CPU emulation.
It means Intel Linux can execute Intel Linux and Arm Linux guest, and Arm Linux can execute Arm/Intel guest.
QEMU is flexible enough to execute Windows guest, so Arm Linux will be able to execute Intel Windows guest.

Following is how to execute Intel x86 Windows on Apple Silicon M1 Mac.

  1. Download a pre-build Arm Ubuntu image and virtualization app for Apple Silicon Mac.
    One of the examples is @mibosshard work at https://twitter.com/mibosshard/status/1331558536728506368
    It is a package of Arm Ubuntu Linux and SimpleVM tool.
    Download it, and extract.
  2. I was not able to customize/build the code of SimpleVM, and found other virtualization app vftool at https://github.com/evansm7/vftool
    Download the source code.
  3. Pre-build Ubuntu does not have enough disk space, so I changed the vftool code as that CD drive will be assumed to disk drive (replace readOnly:true to false), and build.
    Open the vftool project with Xcode, locate readOnly and replace "true" with "false", and do build.
  4. Xcode places the built app at a temporary path. So, I find it by [Show in Finder].
  5. Open macOS terminal and create an empty HDD image by command:
    % cd <<to where Ubuntu_SimpleVM was extracted>>
    % dd if=/dev/zero of=ext4fs-data03.img bs=20g count=0 seek=6

  6. Execute the guest OS by:
    % /Users/xxx/Library/Developer/Xcode/xxx/Products/Debug/vftool -k vmlinuz -i initrd -a "console=hvc0 root=dev/vda" -d image  -m 9000 -c ext4fs-data03.img -net -p 8
  7. Open another terminal and connect to the guest by:
    % screen /dev/ttys001
  8. Ubuntu Linux boot messages and Login prompt will be appeared.
    The root password is described in README.txt of Ubutu_SimpleVM.
    Login as root.
  9. Initialize the filesystem (we will store Windows image at /Data) and mount it by:
    # ls -l /dev/vd*
    # mkfs.ext4 /dev/vdb
    # mkdir /Data
    # mount /dev/sdb /Data
  10. Install QEMU by:
    # apt-get install qemu binfmt-support qemu-user-static docker.io
  11. Install qemu x86_64 from https://github.com/dbhi/qus and https://hub.docker.com/r/aptman/qus/ by:
    # docker run --rm --privileged aptman/qus -s -- -p x86_64
  12. Download a pre-build Intel Windows 10 image from https://app.vagrantup.com/peru/boxes/windows-10-enterprise-x64-eval by (will download 7.5GB, and the password is described at the site):
    # cd /Data
    # wget https://app.vagrantup.com/peru/boxes/windows-10-enterprise-x64-eval/versions/20201203.01/providers/libvirt.box
  13. Extract disk image by (results 15GB):
    # mv libvirt.box w10-box.tar.gz
    # tar xzvf w10-box.tar.gz box.img
    # mv box.img w10-box.img
  14. Before start the guest, check the Ubuntu IP address of emp0s1 interface (will be used for vnc connection) by:
    # ip a
  15. Then, start the Intel Windows by:
    # qemu-system-x86_64 w10-box.img -m size=6000 -vnc :0,password  -monitor stdio -usb -device usb-tablet -accel tcg,thread=multi  -cpu qemu64 -smp 8,maxcpus=8,sockets=2
  16. A prompt (qemu) will be appeared, then set your favorite password for vnc by:
    (qemu) change vnc password
  17. Return to macOS Finder and [Go] => [Connect to Server...], and specify following as Server Address and enter your password:
    vnc://192.168.64.xxx
  18. Finally, QEMU window will be appeared to display the progress of the Intel Windows boot.
    It takes about 30 minutes for the first time and consumes 100% of 8 cores even on Apple M1, because this is software emulation.

This is just an experimental work as beginning.
I will post the performance comparison later.
If you have interest, leave your comment or say Like at my twitter post.

[2021-01-17] UTM app is easy way to execute Arm and Intel guest operating system, so I wrote a post about it.

02 May 2013

OldExpose on Mountain Lion 10.8 within standard features

OldExpose on Mountain Lion 10.8
Uncheck [Group win...]
Mission Control on Mountain Lion 10.8/Lion 10.7
Exposé on Snow Leopard 10.6
[from my past post]

Exposé on Tiger 10.4/Leopard 10.6 (OldExpose)
I found OldExpose solution (original Exposé mode) for Mac OS X Mountain Lion 10.8 at last.
If you know Tiger 10.4 or Leopard 10.5 Exposé, you might love it, and hate it on OS X newer than 10.5.

The first screen shot is OldExplse on Mountain Lion.
To enable OldExpose, open [System Preferences], select [Mission Control], and Uncheck [Group windows by application].

Comparing Exposés from Tiger 10.4/Leopard 10.5 to Lion 10.7/Lion 10.8, original Exposé (so called OldExpose) has been the best Exposé ever.
Disabling [Group windows by application] simulates OldExpose very well.
I let you easily select the target window from many windows opens, by preserving the original window places and sizes compared to others.
[Japanese version of this post]

01 March 2011

Mac OS X Server for Free

Apple's Mac OS X Lion Preview page states "Lion Server is now part of Mac OS X Lion."
It means the most easy to manage server operating system will be free for Mac OS X Lion users.

Macs, iPads, iPhones, and PCs at home or at office will be under single administration in easy way.
You can choose your on promise server or cloud as your like, even at your home.

Nowadays, one or more devices per one person makes complexity.
Mac OS X Lion built in server will be the answer.

20 February 2011

Yet another solution for YouTube black-out problem on Mac Safari ; User-Agent

Since about a week ago, we can not watch YouTube video by Mac Safari.
Once the problem occurred, it cannot be solved by re-installing Flash player, clearing Safari history, nor clearing Safari Cookie.
I found a temporally solution.
  • Change the USER-AGENT of Safari other than [Safair 4.0.5 - Mac] (for example, [Safari 4.0.5 - Windows]) from [Develop] menu If [Develop] menu item on your Safari, use [Preferences...] => [Advanced]
Other solutions are exists, but I think there are some disadvantages;
  • Change the Safari application from 64-bit to 32-bit Apples decided the default is now 64-bit. If you forget to switch back from 32-bit to 64-bit, performance penalty or missing new features will become the problem.
  • Change the YouTube to HTML5 mode You can change YouTube to HTML5 mode by visiting youtube.com/html5 . If the html5 version of video is provided, the problem will be solved. Some or many videos are Flash (FLV) only.
  • Use embed mode of YouTube If the url is http://www.youtube.com/watch?v=ABCXYZ&feature=aaa then, rewrite it as http://www.youtube.com/embed/ABCXYZ You can watch the video in Safari windows as full scaled.
I do not know the problem came from the Flash War, I hope Apple or YouTube solves the root cause early.
[2011-02-21 2:50 JST] Added 4th solution.

22 June 2010

Safari Reader customization - sans-serif font

Safari 5's Reader is incredibly cool. You can customize Safari Reader output by editing "Reader.html" file at "/Applications/Safari.app/Contents/Resources/" folder. This is the way to change the type face from serif to sans-serif both at title and body.
  • The line 7 of Reader.html begins with "<style ". Insert following after the line 7; * { font-family: sans-serif !important; }
Technically, the key for this is style prioritization specification: "!important". Most of the parts of Safari Reader output is based on Reader.html styles, but body paragraphs are overridden by hard-coded Safari output. Please enjoy. Do not forget to backup before make modification to your system. [Japanese version]

18 June 2010

Please update your Flash Player on Mac OS X 10.6.4; current 10.1.53.64, vulnerable 10.0.45.2

If you updated your Mac OS X to 106.4 today or yesterday, you should also check your Flash Player version;
  • current/newest 10.1.53.64
  • vulnerable 10.0.45.2
You can check your Flash version at About Adobe Flash Player site.
Don't miss it.

When Apple released Snow Leopard 10.6.0, they did similar problem.

22 September 2009

Easily Take a Note on Snow Leopard/Leopard

With Notes on iPhone/iPod touch (MobileNotes.app), you can take a note easily and quickly.

On Mac OS X, Notes function of Mail.app is not so quick.
You have to open the Mail, and then call New Note from File menu.
You want to take a note, but you have to open the Mail app, is not intuitive.
So, I made an utility to start taking a note with one click.
If you are using Note Sync with iPhone/iPod touch, this brings synergy.
It is very basic AppleScript applet.
Follow the steps to make it.
  • Open [Applications] -> [Utilities] -> [AppleScript Editor].
  • Copy and Paste following code into AppleScript Editor window.
    tell application "Mail"activate
    end tell
    tell application "System Events"
    tel
    l process "Mail"
    click the menu item "New Note" of the menu "File" of menu bar 1
    -- click the menu item
     "新規メモ" of the menu "ファイル" of menu bar 1
    end tell
    end tell
  • Push [Run] button to test the script. You will see the Mail.app is open and new note window is appeared.
  • Then, do [File] -> [Save as], with "New Note" as file name, and specify [Application] for [File Format].
  • Place the "New Note" icon created into Dock.
To change the icon of "New Note";
  • Save the image at the upper right.
  • Open the image with Preview app.
  • Do [Edit] -> [Select All] or .
  • Do [Edit] -> [Copy] or .
  • Select "New Note" on Finder and do [File] -> [View Info] or .
  • Click the icon on the "New Note Info" window.
  • do [Edit] -> [Paste] or . Then the icon is replaced.

Grid layout of Snow Leopard Exposé ; wrong decision

Grid layout of Exposé on Snow Leopard (with about 60 windows)
Flexible layout of Exposé on Leopard (showing famous 150 window) - There are 2.5 times many windows, but easily distinguish each of them.
The Layout mode of Exposé is changed from Flexible to Grid on Snow Leopard (Mac OS X 10.6).
I like flexible layout of Leopard or Tiger (10.5/10.4).
I think grid layout has following disadvantages.
  • The size of all window will be same. So you can not easily find them.
    For example, large Safari window and tiny Sticky window will have the same size. You can not distinguish which window is Safari and another is Sticky at once.
  • The information "window size" will be dismissed.
  • There is no meaning on Grid itself.
    Grid layout is seems to be smart, but original window layout is analog, and is not aligned each other.
  • Anyway, Grid layout is not fun compared to Flexible layout.
I want original Flexible layout comes back in future.

[Japanese version]

27 June 2009

My Safari 4 on Mac OS X has been always hanged with pages with Flash

Actually, My Mac mini with Safari 4 always hanged with web pages using Flash or YouTube movies.
After months with nightmares, I found it was caused by the conflict between Safari and SafariStand.
I deleted SafariStand, and I got very smooth web surfing with Safari 4.
My fault was that I do not updated the SafariStand after I installed Safari 4.

SafariStand is installed on /Library/Application Support/SIMBL/Plugins/SafariStand.bundle .
I was mistakenly used SafariStand 3.1T161 with Safari 4.
Current version of SafairStand is 4.0T167 and it is compatible to Safari 4.