Skip to content

Instantly share code, notes, and snippets.

@eylenburg
Last active November 16, 2024 12:34
Show Gist options
  • Save eylenburg/38e5da371b7fedc0662198efc66be57b to your computer and use it in GitHub Desktop.
Save eylenburg/38e5da371b7fedc0662198efc66be57b to your computer and use it in GitHub Desktop.
Installing Microsoft Office in Linux

Step by step guide: How to install Microsoft Office in any Linux distribution

There are multiple options how to install MS Office on Linux.

VM-based - Integrate Windows apps running in a Windows virtual machine as native-looking in Linux

  1. Winapps, based on KVM, QEMU, Docker/Podman and FreeRDP. Still actively maintained (getting Github commits). Decribed below
  2. Cassowary, based on KVM, QEMU, libvirt/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 while the Windows apps themselves run flawlessly (as they're running on real Windows) there's various freerdp-related bugs you may encounter.

Wine-based

  1. Crossover (paid) -> supports Office 2016 and older (and apparently even 365 but not sure how stable). It's the easiest way to get a semi-modern office working in Linux without much tinkering. Described below
  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. Described below
  3. Bottles -> didn't work for me, probably because you can't install 32-bit dependencies, but this guy managed to

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).

Winapps Crossover PlayOnLinux 4
Compatible with Office 365, 2024, 2021, 2019, 2016, 2013, 2010, 2007.
All Office components
Office 365, 2016, 2010, 2007.
Excel/Word/Powerpoint
Office 2016, 2013, 2010, 2007.
Excel/Word/Powerpoint
Compatibility rating ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐
What doesn't work Window management can be janky (e.g. using multiple open Office windows). Some components like Onedrive, Outlook and Onenote don't work or with limited features. Might crash from time to time, so always remember to save your work. Some UI bugs or janky window management. Some components like Onedrive, Outlook and Onenote don't work or with limited features. Relatively frequent crashes, so always remember to save your work. Some UI bugs or janky window management.
Cost Free
+ can pirate Office
$60/€60/£60 for Crossover
+ genuine Office license needed
Free
+ genuine Office license needed
RAM use Significant (need to run a Windows VM in the background) Normal Normal
Integration into Linux (e.g. file associations) Good Good Good
Ease of set-up Complicated Easy Easy if the install script happens to work, otherwise complicated.
Compatible with immutable Linux distros Need to layer some extra packages from repo Need to install in Distrobox Need to install in Distrobox*

*There's a Flatpak of PlayOnLinux 4 now but I couldn't get it to run Microsoft Office.

Table of Contents

Option 1: Running any Office version (including 365) with Winapps

Option 2: Using Office 2016 in Crossover (paid)

Option 3: Using Office 2016 in PlayOnLinux

Option 1: Running any Office version (including 365) with Winapps

For steps 1-6 you should check the official documentation as it may have changed. The below steps worked for me in July 2024.

Step 1: install required packages

Winapps requires either Docker or Podman to run the Windows VM and can also work with an existing VM that you manage with libvirt and Virt-Manager. I'll be using Podman in the below instructions.

For the Winapps app itself, you need freerdp to connect to the VM and dialog to run the Winapps installer. On my Fedora Kinoite I also needed to install netcat. If you are using Podman (or Docker) to run the VM you also need podman and podman-compose (or the same for Docker).

For required dependencies see here

In Fedora Atomic (Kinoite/Silverblue), which has podman preinstalled: rpm-ostree install podman-compose freerdp dialog netcat, then reboot.

In OpenSUSE Tumbleweed: sudo zypper install podman podman-compose freerdp dialog netcat-openbsd

Step 2: Download Winapps

Create a new folder ~/bin/winapps and then run git clone https://github.com/winapps-org/winapps.git && cd winapps to download the newest version of Winapps.

Step 3: Spin up the VM

The Winapps folder contains a file called compose.yaml which defines your Windows VM. Please refer to the Winapps documentation for details, but we can just keep the default settings which will install "Tiny11" (a minimal version of Windows 11).

In the Winapps folder, run this command: podman-compose --file ./compose.yaml up

Then open 127.0.0.1:8006 in the browser to access the Windows VM and check that the installation was successful.

Step 4: Create compose.yaml for Winapps

Open the compose.yaml and make these two changes below:

  1. For autostart after a reboot, edit the "restart" line: restart: always

  2. Then comment out the "oem" line: #- ./oem:/oem

  3. Save your edited file here: ~/.config/winapps/compose.yaml

Step 5: Apply the new configuration

Still in the Winapps folder, run podman-compose --file ./compose.yaml down && podman-compose --file ~/.config/winapps/compose.yaml up

Again, check that your VM is running in 127.0.0.1:8006. If the user is logged in (i.e. you can see the desktop) then make sure to log out (Start Menu -> click on the username -> Sign Out).

Step 6: Create your Winapps config file

Create a brand new file called ~/.config/winapps/winapps.conf (same folder where you saved the compose.yaml), and insert this:

RDP_USER="MyWindowsUser"
RDP_PASS="MyWindowsPassword"
WAFLAVOR="podman"
RDP_SCALE=140

The RDP_SCALE line is optional, it is useful when you have a HiDPI monitor and use scaling on the Linux host already. The example above means 140% scaling.

Step 7: Test Winapps

In the Winapps folder, run ./setup.sh which will guide you. In the installer, add Explorer.exe (hint: in the list of installed Windows apps, press "space" to select an app you want to export to Linux). It should now appear in your Linux menu so you can test if it works and you get a Windows Explorer window when launched from Linux.

Step 8: Localisation (optional)

The default VM is set to English US, US keyboard, US timezone etc. To change that, enter the VM through the newly created starter "Windows" in your Linux start menu, and then:

  1. Go to Windows settings and set the correct regional format, display language and keyboard layout.

  2. Start the Registry Editor (right-click on start menu, "Run", regedit)

  • go to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] and add a new DWORD IgnoreRemoteKeyboardLayout with value 1
  • go to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] and add new DWORD RealTimeIsUniversal with value 1
  • then reboot the Windows VM

Step 9: Install Microsoft Office or other required applications

Access the VM through the "Windows" starter. Then install, for example, Microsoft Office 365 and activate it. Pirating works unlike when using Crossover or PlayonLinux.

Step 10: Tidy up Quick Access

This is automatically set up by Winapps, but I would recommend that in the VM, you add the Linux drive (found in "This PC") to the File Explorer's "Quick Access" and remove the other (useless) folders like Documents and Pictures from the Quick Access.

Step 11: Uninstall Winapps (temporarily)

This is needed because we previously (in Step 7) just added Explorer.exe and now we want to add the Office apps too.

  1. Open a terminal in your Winapps folder and run ./setup.sh again and this time select Uninstall.

Step 12: Add Office apps to Linux

Run ./setup.sh another time and this time select "Install" and select all the required apps, e.g. Excel, Word and Powerpoint. (Hint: in the list of installed Windows apps, press "space" to select an app you want to export to Linux)

Troubleshooting: Prevent Windows auto-login

For me, the VM was defaulting to auto-login. However, for Winapps to connect to the VM, the user must be logged out. Otherwise you will just get a black full-screen windows when you attempt to start a Windows app from Linux.

Open the VM (127.0.0.1:8006 in browser if you can't connect through the "Windows" shortcut), then right-click on the start menu, then on "Run", then enter netplwiz and check the [x] Users must enter a user name and password to use this computer option.

Then sign out (Start Menu -> click on the username -> Sign Out).

Troubleshooting: auto-starting the VM

For me, the Podman container containing the Windows VM didn't auto-start after a computer reboot, even though I set restart: always in the the compose.yaml. A workaround would be to create this small bash script and add it to the autostart:

  1. Create the bash script:
#!/bin/bash
sleep 20 && podman-compose --file ~/.config/winapps/compose.yaml start

(I'm not sure why but without the "sleep" bit it didn't work for me. What it does it that is waits 20 seconds before running the "podman-compose" command. So essentially, your Windows apps won't work for the first 20 seconds after logging in. You can try and see if it works without the "sleep 20 && " at the beginning for you or if a shorter sleep time is sufficient.)

  1. You can save this bash script, e.g. as ~/bin/winapps_start.sh.

  2. You also need to make it executable (in KDE's Dolphin file manager: right-click -> Properties -> [x] Executable, in terminal: chmod +x winapps_start.sh)

  3. If you're using KDE Plasma you can add it to the autostart by going to the System Settings and then Autostart (at the bottom) and click on + Add..., + Add Login Script and then select your script.

Troubleshooting: Orphaned owner files in Microsoft Office

I encountered the problem that Microsoft Office will not clean up the owner files on the Linux drive. For example if you open "Book1.xlsx" then Excel will create a file called "~$Book1.xlsx" which is just a few bytes in size and serves the purpose of "locking" this file so other users can't edit it at the same time. Normally these files should be deleted when you close the file, but this didn't happen for whatever reason.

To hide these owner files in KDE's Dolphin file manager:

  1. Go to KDE System Settings -> Default Applications -> File Associations, then search for the mime type corresponding to .xlsx (in this case it's called application/vnd.openxmlformats-officedocument.spreadsheetml.sheet). Select the existing filename pattern (*.xlsx) and click - Remove and then click + Add and enter [!~][!$]*.xlsx. Do the same for docx and pptx.

By default files starting with ~$ have the mime type application/x-trash. By making the above change, a file like "~$Book1.xlsx" will be seen as a trash file rather than a spreadsheet.

  1. Open Dolphin, go to Configure Dolphin -> View and check [x] Also hide backup files when hiding files.

"Backup files" in this case actually refers to all files with the application/x-trash mime type.

To clean up the left-over owner files when you log out:

  1. Create a bash script:
#!/bin/bash
find ~ -type f \( -name '~$*.xlsx' -o -name '~$*.docx' -o -name '~$*.pptx' \) 2>/dev/null -exec rm {} \;

This command will find all files matching the specified patterns (~$*.xlsx, ~$*.docx, and ~$*.pptx) in the home folder (~) and remove them with the rm command. 2>/dev/null is used to suppress any “permission denied” messages for folders you don't have access to.

  1. You can save this bash script, e.g. as ~/bin/office_cleanup.sh.

  2. You also need to make it executable (in KDE's Dolphin file manager: right-click -> Properties -> [x] Executable, in terminal: chmod +x office_cleanup.sh)

  3. If you're using KDE Plasma you can add it as a script to be run on logout by going to the System Settings and then Autostart (at the bottom) and click on + Add..., + Add Logout Script and then select your script.

Option 2: Using Office 2016 in Crossover (paid)

Step 1: Buy and install Crossover

On Ubuntu, Debian, Mint, Fedora

These distributions are officially supported by 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 3: Using Office 2016 in PlayOnLinux

This guide is largely based on this one from Jaydin which comes with some helpful screenshots.

PlayOnLinux contains an install script for Office 2016 and older. If it works for you, then it's all good, but for me it failed and I had to install it manually:

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. 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. 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 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.

@NeoPlayer13
Copy link

just create a custom podman network with the internal flag set to true and add the container or containers that you dont want to have internet access.

@raselrahmanrocky
Copy link

is there anyway to run ms office 2021 in Linux Operating System? 😃

@eylenburg
Copy link
Author

Just with Winapps

@installation-scripts
Copy link

I have been running winapps for years and was searching for the latest release when i found your instructions. Not only are they better then my own but after trying to use Crossover for years, following your instructions actually worked. Thank you!

@waldolemmer
Copy link

waldolemmer commented Nov 6, 2024

I would like to reassure anyone who's planning to use PlayOnLinux but doesn't want to give Microsoft their money that these steps will still work; you just have to figure out where to get an x86 copy of office 2016 and how to activate it. You might not be able to find the two DLLs, but they might not be necessary.

@waldolemmer
Copy link

Also, if anyone can get this working with x64 Office or with a modern version of WINE, I'd love to hear what you did differently. x86 WINE 4.15 isn't very fast on my system, at least not graphically. Maybe it has something to do with the Direct2D registry key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment