Extract .pkg and .mpkg files with xar on Linux

macOS installer packages have the .pkg extension which are xar archives, to extract them on Linux we need to download and compile xar from https://code.google.com/archive/p/xar/downloads.

Operating system:  Linux Debian 9 / kernel 4.9.0-3-amd64

1. Install dependencies

apt-get install build-essential libxml2-dev libssl1.0-dev zlib1g-dev

2. Download and extract xar-1.5.2.tar.gz

wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/xar/xar-1.5.2.tar.gz
tar -zxvf xar-1.5.2.tar.gz

3. Build and install

cd xar-1.5.2
./configure
make
make install

4. Extract files with xar

xar -xvf package_installer.pkg

Boot from USB flash drive without BIOS support via Plop Boot Manager, tested on VirtualBox

If you have an old PC that doesn’t support booting from USB to do that you can use Plop Boot Manager, a small piece of software that allows you to boot from USB, shortly you need to download plpbt, unzip and burn plpbt.iso to a CD and boot from it. In this example we will use VirtualBox, the current version (5.1.26) does not support USB booting.

Boot from USB in VirtualBox

1. Download plpbt, unzip and mount plpbt.iso
2. Open “Settings” go to USB and enable “USB 1.1 (OHCI) Controller”

Enable USB 1.1 OHCI Controller on VirtualBox
Enable USB 1.1 OHCI Controller on VirtualBox

3. Start the virtual machine and attach the USB flash drive from Devices -> USB
4. Reset the virtual machine, Plop Boot Manager should appear and select “USB”