DEV Community

Ryan Teh Hoon Meng
Ryan Teh Hoon Meng

Posted on • Edited on

How to Set Up Microsoft Office on Linux Mint 21.3: A Comprehensive Guide

Transitioning from Windows to Linux can be both exciting and challenging. While Linux Mint 21.3 offers a smooth and enjoyable experience, the absence of an official Microsoft Office version for Linux can be a significant hurdle for many users. Fortunately, there’s a way to bring Microsoft Office apps like Excel, PowerPoint, and Word to your Linux desktop. In this guide, I’ll walk you through setting up Microsoft Office on Linux Mint 21.3 using WinApps and Docker.

Why No Official Microsoft Office for Linux?

It's understandable to feel frustrated by the lack of a native Microsoft Office version for Linux. However, Microsoft’s decision to focus on Windows and macOS makes sense from a business perspective. If transitioning to Linux were as easy as switching between software, more users might leave Windows for Linux. Thankfully, there are alternative methods to access Office apps on Linux.

Using WinApps to Run Microsoft Office on Linux

While native support is missing, you can still use Microsoft Office on Linux by running it in a Windows environment using WinApps (https://github.com/winapps-org/winapps). WinApps renders Windows applications running on a Windows environment on your Linux desktop with the RDP protocal. I chose to run Windows environment via Docker containers. Here’s how you can set it up:

Step 1: Install Docker on Linux Mint 21.3

  1. Follow the Docker Installation Guide: Linux Mint 21.3 is based on Ubuntu 22.04, so you’ll need to follow the Docker installation steps for Ubuntu Jammy Jellyfish. You can find the official guide here (https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository).

  2. Add Docker’s Official GPG Key and Repository:

    • If you encounter errors related to the repository not found for “virginia” (Linux Mint’s code name), you may need to tweak the commands. This error occurs because Docker’s repository does not recognize the “virginia” code name directly. Try the following commands:
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(echo "virginia") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
Enter fullscreen mode Exit fullscreen mode
  1. Configure Docker to Run as a Non-Root User:
    • Create the docker group: sudo groupadd docker.
    • Add your user to the docker group: sudo usermod -aG docker $USER.
    • Log out and log back in for the changes to take effect.

Step 2: Install the Prerequisites

  1. Clone the WinApps Repository:

  2. Install FreeRDP:

    • Since FreeRDP 3 is not available in Linux Mint 21.3’s official repository, install it via Flatpak.
flatpak install flathub com.freerdp.FreeRDP
sudo flatpak override --filesystem=home com.freerdp.FreeRDP # To use `+home-drive`
Enter fullscreen mode Exit fullscreen mode

Step 3: Create a Windows Environment in Docker

  1. Configure Docker:

    • Use the default configurations, credentials, disk space, RAM, etc., provided in the compose.yaml file from the dockur/windows repo.
  2. Start Your Windows Environment:

    • Open your terminal, navigate to the WinApps repo, and run: docker compose up.

Step 4: Install Microsoft Office Apps

  1. Access the Windows Environment:

    • Remote into your Windows environment via http://127.0.0.1:8006.
  2. Install a Web Browser:

    • Install a browser with Microsoft Store.
  3. Install Office 365:

    • Download and install Office 365 as you would on a regular Windows machine.

Step 5: Update Windows Credentials (Optional)

  1. Change the Default Password:
    • The default Windows environment credentials are docker with an empty password. Update this password for added security.

Step 6: Use Microsoft Office Apps on Your Linux Desktop

  1. Create a WinApps Configuration File:
    • Create a configuration file at ~/.config/winapps/winapps.conf containing the following:
RDP_USER="docker"
RDP_PASS=""
#RDP_DOMAIN="MYDOMAIN"
#RDP_IP="192.168.123.111"
#WAFLAVOR="docker" # Acceptable values are 'docker', 'podman' and 'libvirt'.
#RDP_SCALE=100 # Acceptable values are 100, 140, and 180.
#RDP_FLAGS=""
#MULTIMON="true"
#DEBUG="true"
#FREERDP_COMMAND="xfreerdp"
Enter fullscreen mode Exit fullscreen mode
  1. Run the Install Script:

    • Navigate to the WinApps repo and execute: ./setup.sh. Follow the prompts to add Office apps to your Linux desktop.
  2. Additional Applications:

Conclusion

Setting up Microsoft Office on Linux Mint 21.3 might seem like a daunting task, but using WinApps and Docker makes it achievable. By following these steps, you can seamlessly integrate Microsoft Office into your Linux environment, allowing you to continue using familiar tools while exploring the benefits of Linux.

Feel free to leave a comment if you have any questions or run into issues during the setup process. Happy computing!


Top comments (6)

Collapse
 
devtomm profile image
Markus

Thanks for the guide. I get the following errors when trying to run the install script in step 6:

markus@Dell-7480-2024:~/winapps$ ./setup.sh 
################################################################################
#                                                                              #
#                            WinApps Install Wizard                            #
#                                                                              #
################################################################################

Q) Install or uninstall WinApps? --> Install
Q) Configure WinApps for the current user 'markus' or the whole system? --> Current User
Q) Automatically install supported applications or choose manually? --> Manual (Default)

WinApps installation already present at /home/markus/.local/bin/winapps-src. Updating...
Bereits aktuell.
Installing WinApps.
Checking for existing conflicting WinApps installations... Done!
Attempting to load WinApps configuration file... Done!
Checking whether dependencies are installed... Done!
Checking container status... Done!
Checking for an open RDP Port on Windows... Done!
Attempting to establish a Remote Desktop connection with Windows... Failed!

ERROR: REMOTE DESKTOP PROTOCOL FAILURE.
FreeRDP failed to establish a connection with Windows.
--------------------------------------------------------------------------------
Please view the log at /home/markus/.local/share/winapps/FreeRDP_Test_20241210_2039_325222462.log.
Troubleshooting Tips:
  - Ensure the user is logged out of Windows prior to initiating the WinApps installation.
  - Ensure the credentials within the WinApps configuration file are correct.
  - Utilise a new certificate by removing relevant certificate(s) in /home/markus/.config/freerdp/server.
  - If using 'libvirt', ensure the Windows VM is correctly named as specified within the README.
  - If using 'libvirt', ensure 'Remote Desktop' is enabled within the Windows VM.
  - If using 'libvirt', ensure you have merged 'RDPApps.reg' into the Windows VM's registry.
  - If using 'libvirt', try logging into and back out of the Windows VM within 'virt-manager' prior to initiating the WinApps installation.
--------------------------------------------------------------------------------
Exiting with status '14'.
markus@Dell-7480-2024:~/winapps$ more /home/markus/.local/share/winapps/FreeRDP_Test_20241210_2039_325222462.log
[20:39:06:326] [2:00000003] [WARN][com.freerdp.crypto] - [verify_cb]: Certificate verification failure 'self-signed certificate (18)' at stack position 0
[20:39:06:326] [2:00000003] [WARN][com.freerdp.crypto] - [verify_cb]: CN = DOCKERW-C6NHUDQ
[20:39:06:327] [2:00000003] [ERROR][com.winpr.sspi.Kerberos] - [kerberos_AcquireCredentialsHandleA]: krb5_parse_name (Konfigurationsdatei gibt keinen Standard-Realm an [-1765328160])
[20:39:06:327] [2:00000003] [ERROR][com.winpr.sspi.Kerberos] - [kerberos_AcquireCredentialsHandleA]: krb5_parse_name (Konfigurationsdatei gibt keinen Standard-Realm an [-1765328160])
[20:39:06:329] [2:00000003] [ERROR][com.winpr.sspi.NTLM] - [ntlm_fetch_ntlm_v2_hash]: Error: Could not find user in SAM database
[20:39:06:329] [2:00000003] [WARN][com.winpr.sspi] - [winpr_InitializeSecurityContextA]: InitializeSecurityContextA status SEC_E_INTERNAL_ERROR [0x80090304]
[20:39:06:329] [2:00000003] [ERROR][com.freerdp.core.auth] - [credssp_auth_authenticate]: InitializeSecurityContext failed with SEC_E_INTERNAL_ERROR [0x80090304]
[20:39:06:329] [2:00000003] [ERROR][com.freerdp.core.rdp] - [rdp_recv_callback_int][0x641cd0154220]: CONNECTION_STATE_NLA - nla_recv_pdu() fail
[20:39:06:329] [2:00000003] [ERROR][com.freerdp.core.rdp] - [rdp_recv_callback_int][0x641cd0154220]: CONNECTION_STATE_NLA status STATE_RUN_FAILED [-1]
[20:39:06:329] [2:00000003] [ERROR][com.freerdp.core.transport] - [transport_check_fds]: transport_check_fds: transport->ReceiveCallback() - STATE_RUN_FAILED [-1]
[20:39:06:329] [2:00000003] [ERROR][com.freerdp.core] - [rdp_client_wait_for_activation]: ERRCONNECT_CONNECT_TRANSPORT_FAILED [0x0002000D]

Enter fullscreen mode Exit fullscreen mode

I have a few questions:

  • do I have to change anything in the config file from 6.?
  • is the bew install script started with ./setup.sh?

Thanks a lot
Markus

Collapse
 
ryantehhoonmeng profile image
Ryan Teh Hoon Meng

Yes, you are correct. It has since been updated to ./setup.sh. For the error you are seeing, have you tried restarting Windows and then Sign out the user? I retested these steps on Linux Mint 22, and was able to reproduce your error and resolved it by restarting and signing out the user.

Collapse
 
tvandorffy profile image
Tamas Vandorffy

Great guide, thanks for sharing.
I followed the guide and my docker windows is actually working.
I accessed the windows env with a browser using the url
localhost:8006, but I found that the cross clipboard functionality does not work or not configured. Is there way to enable this?
Also, when I try to access the machine with freerdp3 using the command xfreerdp3 /sec:rdp /v:localhost:8006 /u:docker +clipboard
I get the following error message:
[22:33:45:23] [79094:000134f7] [ERROR][com.freerdp.core.nego] - [nego_connect]: Protocol Security Negotiation Failure
[22:33:45:23] [79094:000134f7] [ERROR][com.freerdp.core] - [rdp_client_connect]: ERRCONNECT_SECURITY_NEGO_CONNECT_FAILED [0x0002000C]
[22:33:45:23] [79094:000134f7] [ERROR][com.freerdp.core.connection] - [rdp_client_connect]: Error: protocol security negotiation or connection failure
Could you please help? Thanks a lot!

Collapse
 
ryantehhoonmeng profile image
Ryan Teh Hoon Meng

Unfortunately, I am not familiar with x11 and freerdp to be able to help you. Hope you found a solution for it and share it here for future readers.

Collapse
 
kishore_kevin_63047f1417c profile image
KISHORE kevin

We can use libreoffice , instead of using Microsoft office in linux

Collapse
 
ryantehhoonmeng profile image
Ryan Teh Hoon Meng

Libreoffice is a good alternative to Microsoft office. I do recommend my friends and family to use it even on Windows. However, I have an active Microsoft 365 Family subscription and I am too used to OneNote that can sync across Android, Apple, and Windows. I own an Android Phone, a Linux desktop, a MacBook, and a Surface.