How to create a macOS virtual machine easily — and for free

25 March 2017, 13:58

Feature head image

Recently the folks behind the useful but expensive Parallels Desktop virtualization app released Parallels Desktop Lite, which is available in the Mac App Store. Although it requires an in-app purchase if you want to install Windows as a virtual machine, Parallels Desktop Lite is entirely free of charge if you just want to install Linux or macOS as a virtual machine. It’s also quick and easy to use – a far cry from other methods up until now that have been complicated, time-consuming and of dubious legality.

Here are the steps required to create a macOS virtual machine using Parallels Desktop Lite.

  1. Open the Mac App Store on your Mac and search for Parallels Desktop Lite. Click to “buy” it and install it (it’s free).
  2. Remaining in the Mac App Store, search for the version of macOS that is installed on your Mac. For example, if this is Sierra then search for that. Click to Download it, if it isn’t already downloaded. Note that once the download finishes the macOS installer will automatically start, but you don’t need this and can simply click the Quit menu option.
  3. Open Parallels Desktop Lite and choose the free use option. Its label tells you that this merely lets you install Linux. For some reason this doesn’t mention macOS, but using Parallels Desktop Lite to install macOS is possible – and if you read the App Store description you’ll see it’s mentioned there.
  4. Next, click the right-hand option in the New Virtual Machine window – “Install Windows or Another OS from a DVD or Image File” – and click Continue.
  5. macOS will appear in the list, so simply click Continue to carry on. Main feature illustration
  6. You’ll be told a bootable disk image file will need to be created, which is fine – this will happen automatically. Just click the Continue button. The default save location for the image file is OK, so just click Select in the File Open/Save dialog box that appears.
  7. Once creation of the disk image has finished, you’ll be prompted to give the new virtual machine a name, and choose a location to save it. Once done, click Continue.
  8. Your new virtual machine will boot, and installation will begin as if you’re booting a new Mac. Select to install macOS from the recovery menu when it appears, and ensure the power is attached if you’re using a portable Mac, otherwise installation cannot continue. Note that there was a weird bug on my MacBook Pro that meant the screen was stretched in an odd way, but resizing it slightly by clicking and dragging the edge fixed this.
Main feature illustration

Once installation has finished, you can simply click the red close button at the top left of the virtual machine window to suspend your virtualized macOS. Each time you start Parallels Desktop Lite you’ll be able to click the large play button to unsuspend the macOS virtual machine.

For what it’s worth, creating a macOS/OS X virtual machine in this way is entirely legal. The macOS/OS X End-User License Agreement (EULA) provides explicit permission: “… you are granted a limited, non-transferable, non-exclusive license… (iii) to install, use and run up to two (2) additional copies or instances of the Apple Software within virtual operating system environments on each Mac Computer you own or control that is already running the Apple Software, for purposes of: (a) software development; (b) testing during software development; (c) using macOS Server; or (d) personal, non-commercial use.”

Leave a comment... [13]

How to zoom into photos down to pixel level on iOS

17 March 2017, 02:03

Feature head image

Here’s a neat little trick that lets you overcome the iPhone/iPad’s deliberately limited pinch-expand zoom. It lets you zoom into images right down to individual pixels.

Start by opening the picture you want to zoom in on. Tap the edit button, as indicated below…

Main feature illustration

… then tap the rotate/crop button. Tap to rotate the image 90 degrees, then tap Done.

Now repeat all the above, but this time rotate the image back to the way it was (that is, you’ll need to tap the rotate button three times). Tap Done.

Main feature illustration

You will now be able to zoom into the image via the pinch-expand gesture, and will be able to keep going all the way down to pixel detail – although the pixels will be blurred because of the way iOS handles zoom.

Note that this only works for as long as you have the picture open for viewing. If you close it, and then open it again, the usual zoom limitation will be applied again and you’ll have to repeat these steps if you want pixel-level zoom.

Leave a comment...

Kill all logging in macOS Sierra – and (maybe) save battery life

16 March 2017, 10:00

Feature head image

A few days ago I blogged about how to deactivate runaway logging for certain apps and processes in macOS, something which seems to be a very recent problem introduced with the macOS Sierra update. It has been known to consume increasing amounts of CPU time, making the fans spin-up and gobbling-up battery life on portable Macs.

Below are the steps required to turn off, as much as is possible, all app and process logging in macOS Sierra. Again, I have to point out that this only turns off logging and as such is utterly harmless. You’re not quitting any apps or processes, or hindering them in any way.

I have to admit that this is an effective but ultimately hacky solution for turning off logging but I’m unable to find any other way of achieving it (and certainly not an “official” method – I don’t believe Apple ever intended anybody to turn off logging, even though 99.99% of users do not need it or are unaware of it).

The benefits of turning off most app/process logging might include significantly improved battery life. This is what I believe I’ve experienced, in any event. Let me know in the comments below what your findings are.

What we’re going to do
The steps below aren’t for beginner users, and consist of two main components. The first is a script that simply runs through virtually all possible process IDs (PIDs), and upon finding a PID that matches an actual app or process, summarily kills its logging. Just before quitting the script deletes any existing log files to free-up disk space. The second part of the hack involves a launchd plist that causes this script to run each time the Mac boots, and every 30 minutes subsequently. It runs in the background, invisibly, and is set to have the least possible impact on your system. In other words, you shouldn’t be aware it’s there aside from the fact that using the Console app should show significantly fewer entries.

Nonetheless, you do need to remember the hack is in place. Apple might fix the whole runaway logging problem in an update of macOS, for example, making it redundant. Or you might actually need the diagnostic data that logging provides in order to solve a problem with your computer. I also provide instructions below detailing how to deactivate this hack.

Remember: These steps only work on macOS Sierra (and possibly later releases of macOS). They will NOT work on earlier version of OS X, which used a completely different logging system.

The steps required
Here are the steps required:

  1. Open the Terminal app, which you’ll find in the Utilities folder of the Applications list of Finder.

  2. Copy and paste the following into the Terminal window, entering your login password when prompted. You might see a scary-looking warning message but this is fine and you can continue. Note that this is a single line of code even though it might appear as several lines in your browser – just triple-click any line to select the whole thing, then Cmd+C to copy it, before hitting Cmd+V to paste it into the Terminal window:
    sudo curl -L > /usr/local/bin/;sudo chmod +x /usr/local/bin/

  3. In the Terminal window type whoami, and then select and copy the result.
    Main feature illustration

  4. In the Terminal window, type the following, which will open the script for editing in the Terminal window:
    sudo nano /usr/local/bin/

  5. Using the cursor keys, move the text cursor to the very bottom line. See the word USERNAME? Delete this, and then paste in what you copied in Step 3. For example, on my system where my username is keir, this is how that last line in the file looked:
    rm -rf /Users/keir/Library/Logs/*

  6. In the Terminal window tap Ctrl+O, hit Enter, and then Ctrl+X. This will save the file and close the text editor. Note that you’re using the Ctrl key there, not the Cmd key!

  7. Copy and paste the following into the Terminal window – again it’s a single line of code, so triple-click etc.
    sudo curl -L > com.mackungfu.kill-logging.plist;sudo cp com.mackungfu.kill-logging.plist /Library/LaunchDaemons/;rm com.mackungfu.kill-logging.plist

  8. Finally, type the following to activate everything (again, this is a single line of code):
    sudo launchctl load -w /Library/LaunchDaemons/com.mackungfu.kill-logging.plist

You can now close the Terminal window. The log killing background service is now running, and will restart upon every boot of the computer.

Should you want to turn off the logging killing service, paste the following into Terminal (which again is a single line):

sudo launchctl unload -w /Library/LaunchDaemons/com.mackungfu.kill-logging.plist

If you want to remove the scripts added previously, paste in the following (again a single line of code):

sudo rm /usr/local/bin/; sudo rm /Library/LaunchDaemons/com.mackungfu.kill-logging.plist

Problems with this method
As you might realise if you implement the steps above, this is not a perfect solution. Any apps or processes that launch between instances of the script running in the background will not be blocked from spewing log output. Some launch, spew log output for a few minutes, and then quit. However, the script will eventually run again on its 30 minute cycle so any long term offenders should get caught and dealt with. Additionally, because Safari treats each new browser tab as a separate process, a big issue is that Console log output will fill quickly once more with masses of* log output, and the method above doesn’t address this. However, in stopping most other log output, the benefits are still very significant.

Main feature illustration

Many thanks to Jon H for creating the bash script used here.

Leave a comment...

Turn off runaway logging on macOS

14 March 2017, 10:00

Feature head image

Since the release of macOS, which features a new logging system, some people have reported certain apps going crazy with the massive amount of log writing they do. This can get so bad that the Mac gets hot because it’s working so hard to write the data. Typically the log is viewed in the Console app, which you’ll find in the Utilities folder of the Applications list.

(If you don’t know what logging is in the context of computing, Wikipedia can help.)

All existing information you might find online about turning off or otherwise controlling OS X/macOS’s logging is now obsolete, thanks to the changes in macOS. Therefore, below are the steps that do actually work in order to turn off logging for any particular app or process. I haven’t yet found a way to turn off logging entirely, for all apps and the entire system, and my guess would be this is impossible because Apple’s engineers didn’t believe it would ever be necessary. However, if you know of a way then please let me know in the comments below.

  1. Open a Terminal window, which you’ll find in the Utilities folder of the Applications list within Finder.
  2. Using Console, as discussed earlier, find the name of the runaway logging process or app. In the Terminal window type pgrep -il, and then the name of the app or process. For example, if the process was touchui then I would type the following:
    pgrep -il touchui 
  3. Make a note of the number alongside the process in the results (this number is know as the process ID, or PID). Note that the results might include extraneous entries that you can ignore. If nothing appears, try searching for just part of the name of the app or process – to continue the example above, you might search just for touch.
  4. In the Terminal window paste in the following, before typing the number you discovered earlier:
    sudo log config --process=
  5. After typing the number, hit Space and then paste in the following:
    --mode "level:off"
  6. The line you end-up with should look something like the following (which is a single line even though it may appear on two lines in your browser). In my example the number returned by the pgrep command for my errantly logging app was 65:
    sudo log config --process=65 --mode "level:off"
  7. Hit Enter, and type your login password when prompted. You might see a serious-looking warning. Don’t worry about it.
  8. The results will take effect instantly, and you can close the Terminal window. From this point on, and until you reboot, the runaway logging app’s log output will not be logged.
Main feature illustration

It’s very important to note here that you’re merely turning off log output for that particular app or process. You aren’t killing the app or process itself, or hindering how it runs in any way.

To turn logging back on for that app or process it’s easiest to simply reboot the computer but if that’s not possible then the following should do the trick. You’ll need to replace PID after ––process with the number you discovered earlier:

sudo log config --process=PID --mode "level:default"

Leave a comment... [2]

◀︎ Older /
Recently on MKF
/ Newer ▶︎