# Step by step guide: How to install Microsoft Office 2016 in any Linux distribution There are multiple options how to install MS Office on Linux. **VM-based** - Integrate Windows apps running in a Windows VM as native-looking in Linux 1. [Winapps](https://github.com/winapps-org/winapps), based on KVM, QEMU, Virt-Manager, and FreeRDP. Still actively maintained (getting Github commits). 2. [Cassowary](https://github.com/casualsnek/cassowary), based on KVM, QEMU, Virt-Manager, and FreeRDP. Has a helpful GUI and apparently can auto-suspend the VM when no Windows app is in use. Last release in Feb 2022 and seems to be abandoned. The VM-based options means can run Office 2021 or Office 365 including all apps, but for me it was quite buggy and when I encounterd some (FreeRDP-related?) bug in both Winapps and Cassowary that meant I could only start Excel with an external screen plugged in, I gave up. [bug](https://github.com/winapps-org/winapps/issues/65) **Wine-based** 1. Bottles -> didn't work for me, probably because you can't install 32-bit dependencies 2. PlayOnLinux -> the Office 2010 script worked for me, Office 2013 script not tested, Office 2016 failed to install with their script but it is possible with some tinkering (see below). Newer versions of Office are not supported. 3. Crossover (paid) -> apparently supports Office 2016 and older. It's the easiest way to get a semi-modern office working in Linux without much tinkering. The Wine-based options limit you to Office 2016 or older and only the core apps (Excel, Powerpoint, Word) are working. Office 2016 is still mostly okay and quite similar to the newest Office versions, although you're going to miss out on some useful Excel function like `IFS`, `MINIFS`, `MAXIFS`, `XLOOKUP`, `UNIQUE`, and `SWITCH` ([see here for a full list](https://bettersolutions.com/excel/functions/updates.htm)). **[Option 1: Using Office 2016 in Crossover (paid)](#option-1-using-office-2016-in-crossover-paid)** **[Option 2: Using Office 2016 in PlayOnLinux (free)](#option-2-using-office-2016-in-playonlinux-free)** # Option 1: Using Office 2016 in Crossover (paid) ## Step 1: Buy and install Crossover ### On Ubuntu, Debian, Mint, Fedora These distributions are officially supported by [Crossover](https://www.codeweavers.com/crossover/) so just install it and follow the in-app instructions on how to install Microsoft Office 2016. ### On other distributions (e.g. OpenSUSE, Arch, Mageia, OpenMandriva) OpenSUSE can run the RPM for Fedora, but it's not tested by the Crossover team. For other distros, there's a generic installer available. ### On immutable distributions like Fedora Atomic (Kinoite/Silverblue) The problem here is not installing Crossover itself (you could just layer the RPM) but that Crossover expects to be able to install all other (many) the packages that MS Office 2016 requires. The below is a guide on how to install it in a Distrobox instead. Prerequisite: You have bought a license for MS Office 2016 and for Codeweavers Crossover. Also you have the installer for MS Office 2016 downloaded already. **1. Install distrobox:** ```rpm-ostree install distrobox``` then reboot to apply changes. **2. Create a new distrobox container.** This should be one of the officially supported distributions for Crossover (e.g. Debian, Fedora, Ubuntu). In this example I'll go with Debian Sid because it's rolling so you won't ever have to think about upgrading your container distro to the next version. ```distrobox-create --name debian --image docker.io/library/debian:testing``` **3. Some preparations** ```distrobox enter debian``` ```sudo apt install gdebi``` ```sudo dpkg --add-architecture i386``` **4. Install Crossover** Still in the Distrobox: ```wget http://crossover.codeweavers.com/redirect/crossover.deb``` ```sudo gdebi crossover.deb``` **5. Register your Crossover license** Still in the Distrobox: ```sudo /opt/cxoffice/bin/crossover``` (need to start Crossover as root to register your license) then register you license in the app and close the app. **6. Install dependencies for Office 2016** Still in the Distrobox: ```sudo apt install gdebi libc6:i386 gstreamer1.0-plugins-base:amd64 gstreamer1.0-plugins-base:i386 gstreamer1.0-plugins-good:amd64 gstreamer1.0-plugins-good:i386 gstreamer1.0-plugins-ugly:amd64 gstreamer1.0-plugins-ugly:i386 libc6:i386 libcups2:i386 libdbus-1-3:i386 libfontconfig1:i386 libfreetype6:i386 libgcc-s1:i386 libgl1-mesa-dri:i386 libgl1:i386 libgnutls30:i386 libgstreamer1.0-0:amd64 libgstreamer1.0-0:i386 libnss-mdns:i386 libpcsclite1:i386 libpulse0:i386 libsane1:amd64 libsane1:i386 libudev1:i386 libunwind8:amd64 libvulkan1:i386 libx11-6:i386 libxcomposite1:i386 libxcursor1:i386 libxext6:i386 libxfixes3:i386 libxi6:i386 libxinerama1:i386 libxrandr2:i386 libxrender1:i386 libxxf86vm1:i386``` **7. Install Office 2016** Still in the Distrobox: ```/opt/cxoffice/bin/crossover``` to start Crossover as a normal user then install Office 2016 through the GUI. **8. Create starters that work in your host system** To export the desktop files, enter these commands in the distrobox container: ```distrobox-export --app 'PowerPoint 2016'``` ```distrobox-export --app 'Word 2016'``` ```distrobox-export --app 'Excel 2016'``` If it doesn't work because the starters are missing in the container, open Crossover again (`/opt/cxoffice/bin/crossover`), select the Office 2016 bottle, click on `Edit Menus` and then `Recreate`. Finally enter ```logout``` in the distrobox terminal. **9. Get rid of broken starters that don't work in your host system** Finally you can optionally delete all files starting with "cx" in `~/.local/share/applications`, as these only work when called from the distrobox container but not from the host. ## Step 2: Tweaks after the Microsoft Office installation **1. Register Office** From the Crossover window, start one of the programs (Word, Excel, Powerpoint) and enter your license key (this can be found in your purchase history on office.com - it's not the same key as what's found in the box if your bought a physical copy). **2. (optional) Fix date format** By default, the date format is American (mm/dd/yyyy). To change it in Crossover, click on "Run command" in your bottle, then enter the command `regedit`. In the registry editor go to `HKEY_CURRENT_USER\Control Panel\International` and change `sShortDate` (e.g. from M/d/yyyy to d/M/yyyy). Then close the window and click on `Simulate Reboot` in the Crossover bottle. Now you can close the Crossover window. # Option 2: Using Office 2016 in PlayOnLinux (free) This guide is largely based on [this one from Jaydin](https://askubuntu.com/questions/975104/how-do-i-install-ms-office-2016-on-playonlinux) which comes with some helpful screenshots. ### Step 0: Get Office Log in to your Microsoft account, download the MS Office "offline" image (multiple GB, ending in .img) and note down your product key (this can also be found in your Microsoft account at the same place where you download the .img file) --- ### Step 1: Mount the installation disk For example `mkdir ~/msoffice/msoffice2016/image && sudo mount -o loop Office2016HomeStudentRetail.img ~/msoffice/msoffice2016/image/` --- ### Step 2: Install Distrobox: This is recommended to keep the various Wine packages separate from your system and to be able to nuke the container and start afresh if something goes wrong or stops working. * OpenSUSE: `sudo zypper install distrobox podman` (or install through Yast Software) * OpenSUSE Kalpa/Aeon: already preinstalled * Fedora: `sudo dnf install distrobox` * Fedora Kinoite/Silverblue: `sudo rpm-ostree install distrobox` and reboot * Debian 12 & Ubuntu 23.04 and newer: `sudo apt install distrobox podman` * Arch: `sudo pacman -S distrobox podman` * For other distros, look here: https://github.com/89luca89/distrobox#installation --- ### Step 3: Set up your container We will be using a Ubuntu 18.04 container because this is the last version supporting 32-bit packages. Yes, Ubuntu 18.04 is end-of-life and won't get any more security updates, but the same is true for Office 2016. I would recommend to have a separate /home folder for the distrobox container to avoid mixing files with your normal /home folder and to make backup and restore easier. For the below example I have created folder called `~/msoffice/msoffice2016` which I will use as the container's /home folder. Enter this command to create and enter your Ubuntu 18.04 distrobox: `distrobox-create --name msoffice2016 --image docker.io/library/ubuntu:18.04 --home ~/msoffice/msoffice2016/ && distrobox enter msoffice2016` --- ### Step 4: Set up PlayOnLinux in container Now you're inside the Distrobox container with Ubuntu 18.04. Enter these commands: `sudo dpkg --add-architecture i386` `wget -q "http://deb.playonlinux.com/public.gpg" -O- | sudo apt-key add -` `sudo wget http://deb.playonlinux.com/playonlinux_bionic.list -O /etc/apt/sources.list.d/playonlinux.list` `sudo apt-get update` `sudo apt-get install netcat gettext wine-stable:i386 smbclient winbind playonlinux winetricks` `winetricks dotnet45` and follow the .NET installation wizard that pops up. --- ### Step 5: Prepare PlayOnLinux Still in the Distrobox, enter the command `playonlinux` to start PlayOnLinux in the Ubuntu container Click on `Tools -> Manage Wine Versions` and in the `Wine versions (x86)` tab select version `4.15` and click on `>` to start the installation of this Wine version. _Note: version 4.15 is ancient and Office will probably be running more stable on a newer version of Wine, but in my tests it failed with other/newer versions while 4.15 at least it proven to kind of work._ You'll be asked to install Wine Mono and Wine Gecko. Install both. On the PlayOnLinux main window, click `Configure` and then `New` in the bottom left to create a virtual drive. * Select `32 bits windows installation`, then `Next` * Then select Wine version 4.15 (not System) and click on `Next` * Then give your drive a name of your choice such as `msoffice2016` and click on `Next`. (The virtual drive will now be set up. Once the virtual drive creation is complete, you should be back in the main PlayOnLinux configuration screen. Ensure the newly created drive (eg `msoffice2016`) is selected on the left window.) Click on the `Install components` tab at the top. Then scroll down to select `msxml6` and click `Install`. Afterwards, scroll down to select `riched20` and click `Install` Next, go to the `Wine` tab and click on `Configure Wine`. A window will pop up. * On the `Application tab`, make sure the Windows version is set to Windows 7 (should be the default). * Then go to the `Libraries` tab and select `msxml6` and click `Edit` and choose `Native then Builtin`. Repeat the same for `riched20`. * Then go to the `Graphics` tab and potentially bring up the `Screen resolution`. The default is 96 dpi which looks way too small on my HiDPI screen and 144 dpi works much better. Then close the small window to return to the PlayOnLinux configuration screen. Still in the `Wine` tab, click on `Registry Editor`. * In the registry editor window that popus up, select `HKEY_CURRENT_USER -> Software -> Wine` on the left, right click on `Wine` and click `Edit -> New Key` and name this new key `Direct2D`. * Then right-click the newly created `Direct2D` key and click `Edit -> New -> DWORD Value` and name it `max_version_factory`. Then close the registry editor window to return to the PlayOnLinux configuration screen. --- ### Step 6: Install Office In the PlayOnLinux configuration screen, click on the `Miscellaneous` tab and then `Run a .exe file in this virtual drive`. A file picker will pop up. Navigate yourself to where you have mounted installation disc (in this example /home/user/msoffice/msoffice2016/image/). Enter the `Office` folder and select the file `Setup32.exe`. Now the installation begins. Note that the installer screen doesn't work properly and won't tell you the progress of the installation. If you're lucky you'll get a tray icon that if you click on it will tell you the progress of the installation and at the end will tell you that the installation has finished. If you're unlucky and don't get that tray icon, then wait a sufficient time until you think the installation may have finished, e.g. wait half an hour and monitor if anything is still happening in the terminal or task manager (CPU, disk write). When the installation is complete, or you _think_ it may have completed, close the PlayOnLinux configuration screen (if window decorations are missing to close the window, use the Alt+F4 shortcut to close it). You'll be back at the main PlayOnLinux screen. Select `Tools -> Close all PlayOnLinux software`. --- ### Step 7: Finishing up Start your file manager (e.g. Dolphin or Gnome Files) and go the wineprefix folder set up by PlayOnLinux. In my example this would be in `~/msoffice/msoffice2016/.PlayOnLinux/wineprefix/msoffice2016/` and from there continue navigating to `drive_c/Program Files/Common Files/Microsoft Shared/ClickToRun/`. Find the files `AppvIsvSubsystems32.dll` and `C2R32.dll` and copy them to `drive_c/Program Files/Microsoft Office/root/Office16/` --- ### Step 8: Defining apps in PlayOnLinux Go back to the PlayOnLinux window and click on `Configure` (make sure `msoffice2016` or whatever you named your virtual drive is selected on the left). Stay on the `General` tab and click `Make a new shortcut from this virtual drive` Now PlayOnLinux will search for .exe files on the virtual drive. Select `EXCEL.EXE` and name the shortcut `Excel`, then the wizard starts again, select `WINWORD.EXE` and name it `Word`, then select `POWERPNT.EXE` and name it `Powerpoint` and lastly select `I dont' want to make another shortcut` to exit. --- ### Step 9: Test and activate Office On the PlayOnLinux main screen, you'll now see the three apps Excel, Word and Powerpoint. Click on one of them and then on `Run` to start the app. Hopefully it will start and run without crashing! You'll get asked for your product key. Enter the one you got from your Microsoft account or Office.com. Logging in your the Microsoft account from within Office either doesn't work or crash the application, so you won't be able to log in (for Onedrive etc) but Office still says that it's activated when you use the product key. --- ### Step 10: Unmount disc Close all Office windows, close PlayOnLinux, then leave your Distrobox by typing `logout` in the terminal. `sudo umount ~/msoffice/msoffice2016/image` (adjust path accordingly) to unmount the installation disc. --- ### Step 11: Add .desktop entries In KDE, right-click on the start menu and select `Edit Applications`. Select the `Office` category and click on `New Item`. Define it like this: * Name = `Excel` * Program = `/usr/bin/distrobox` * Command-Line Arguments: `enter -n msoffice2016 -e 'playonlinux --run Excel'` (where msoffice2016 is the name of your Distrobox container) _In Gnome or Xfce you may have to define your .desktop files manually, like described [here](https://medium.com/@insomniocode/linux-creating-a-desktop-shortcut-launcher-2088d1e3c83e). It should read `Exec=/usr/bin/distrobox enter -n msoffice2016 -e 'playonlinux --run Excel'`_ Then do the same for Word and Powerpoint. If you want, you can add logos as well (download them from Wikipedia for example). Now, next time you see e.g. an `.xlsx` file you can right-click on the file -> `Open With -> Other Application -> Office -> Excel` (this is the example for Dolphin, if you use another file manager it will probably be similar). Or to set it as the default, right-click on the file -> `Properties` -> `General` tab -> `Change` button next to "Open With: ..." and select Excel the same way (again, this is for Dolphin). Repeat the same for `.docx` (Word) and `.pptx` (Powerpoint). Or if you have KDE Plasma as your desktop, do it from `KDE System Settings -> Applications -> File Associations` instead. --- ### Step 12: Fix locale settings (optional) By default Excel will use American settings, for example if you enter 1/12/23 Excel will think it is the 12th of January rather than the 1st of December. Or if you're European you'll want to use "." as a thousand separator and "," as a decimal separator rather than the other way round. To fix stuff like this: Start PlayOnLinux in Distrobox again with `distrobox enter msoffice2016 && playonlinux` Start the registry editor again (go to `Configure` -> select the `msoffice2016` virtual drive on the left -> `Wine` tab -> `Registry Editor`) Navigate to `HKEY_CURRENT_USER\Control Panel\International` and start editing some of the values. A good overview is [here](https://renenyffenegger.ch/notes/Windows/registry/tree/HKEY_CURRENT_USER/Control-Panel/International/index). For example for UK settings, you can use: ``` "sLanguage"="ENG" "Locale"="00000809" // this is for the keyboard layout, use the correct 8-digit number from here: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-8.1-and-8/hh825682(v=win.10) "LocaleName"="en-GB" // you can also find these codes in the above link "sCurrency"="£" "sDate"="/" "sDecimal"="." "sMonThousandSep"="," "sList"="," "sLongDate"="dd MMMM yyyy" "sShortDate"="dd/MM/yyyy" "sThousand"="," "sTime"=":" "sTimeFormat"="HH:mm:ss" "sShortTime"="HH:mm" "sYearMonth"="MMMM yyyy" ``` --- ### Step 13: Backup your set-up (optional) Back up your container: `podman container commit -p msoffice2016 msoffice2016_container && podman save msoffice2016_container:latest | gzip > msoffice2016_container.tar.gz` (see [here](https://github.com/89luca89/distrobox/blob/main/docs/useful_tips.md#container-save-and-restore) for the official documentation) Then back up your container's /home folder by creating an archive (.tar.gz, .zip, whatever) of your complete `~/msoffice/msoffice2016` folder, or whatever location you chose (good that you set up a separate /home folder, right?). _to restore your backup:_ Create a new empty folder ~/msoffice (delete the old one if needed) and extract the contents of your /home folder backup. Now you should have restored your old container /home folder in `~/msoffice/msoffice2016`. Then locate your container backup (the msoffice2016_container.tar.gz) an restore the container by running the command `podman load < msoffice2016_container.tar.gz && distrobox-create --name msoffice2016 --image msoffice2016_container:latest --home ~/msoffice/msoffice2016/` --- ### Step 14: Disable Internet access for the container (optional) As both Office 2016 and Ubuntu 18.04 are "end of life", and will not receive any more security or feature updates, there is no need for them to access the Internet. _At this point I haven't found a good way to disable Internet access to the container. You'll need Internet for the initial set-up of the container. As a workaround you can use the `--clone` flag to clone the existing container into a new one, while adding the `--unshare-netns` flag. But I haven't tested it._