Technical Articles
Running SAP NW 7.52 SP4 trial in docker in Windows Subsystem for Linux 2
The start
I was triggered by the blog that Nabi Zamani has written more than a year ago, I tried to run the docker container on my Windows laptop but unfortunately I ran into some issues. While checking the blog I noticed that other community members also struggled with it. So why not try to fix those issues then and share the solution with you?
On top of that I’m very interested in running Linux on my Windows machine, since some development stuff just works better on Linux 🙂
Depending on your preferences, you can choose between these 3 options:
In option 1 I updated the original blog to make it run on Docker Desktop for Windows with the SAP NW 7.52 SP4 trial.
In option 2 I used Docker Desktop for Windows with Windows Subsytem for Linux 2 as backend.
In option 3 I cheated and ran Docker directly on Ubuntu using Windows Subsytem for Linux 2 (this without Docker Desktop for Windows).
Windows Subsystem for Linux (WSL)?
The title already gives it away: WSL allows you to run Linux on your Windows 10 machine without a virtualisation tool like e.g. Hyper-V, VMWare, Parallels…
Version 1 of WSL does not support Docker so I used version 2 of WSL which will come out in a few months. Version 2 has a Linux kernel on board.
Prerequisites
For option 1 I used Windows 10 v1909 OS build 18363.476 and Docker Desktop for Windows v2.1.0.5 (40693)
For option 2 and 3 I used Windows 10 v2004 OS build 19037.1 (Insider version) and Docker Desktop for Windows v2.1.6.1 (40900)
Option 1
After making some adjustments to the instructions writtten on the original blog, this is the result:
1. Install the stable release of Docker Desktop for Windows
2. Increase the Disc Image Size in your Docker preferences (add 100 GB disk size and at least 6 GB RAM):
3. Install Git and clone this repo:
git clone https://github.com/nzamani/sap-nw-abap-trial-docker.git
4. Download SAP NW ABAP 7.52 SP04 Trial from SAP (search for 7.52)
5. Create a new folder sapdownloads in sap-nw-abap-trial-docker and extract all downloaded files. The result should look like this:
6. Create and start a container. Note: here we have an important difference with the original post. The privileged attribute allows the container to change the vm.max_map_count setting. Therefore we don’t need to change it in advance.
docker run --privileged -p 8000:8000 -p 44300:44300 -p 3300:3300 -p 3200:3200 -h vhcalnplci --name nwabap752 -it nwabap:7.52 /bin/bash
7. Now start the installation of SAP NW ABAP 7.52 Trial
/usr/sbin/uuidd ./install.sh
8. The installation is successful when you see the following message: Installation of NPL successful
9. Check the original post to start/stop and perform post installation steps.
Option 2
Since we now have a working docker container, let’s change scenery and use WSL 2.
To run Windows Subsystem for Linux 2 we need to update Windows 10 to the latest Insider version. Please keep in mind that the Insider version of Windows 10 might not be stable. I used a spare laptop to test this.
Enable Insider version
In Windows, go to settings – update & security – Windows Insider Program and hit the “Get started” button. Login with a Microsoft account.
Choose the Fast ring:
Check for updates after rebooting the system and install them. In that way you will get the latest version of Windows 10.
Enable WSL2
Open a powershell terminal in admin mode and execute the following statements:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Reboot the system.
Install Ubuntu
Go to the Microsoft Store and install Ubuntu 18.04 LTS:
Download and install Ubuntu:
Start Ubuntu:
Enter a username and password that is not related to your Windows user/pass:
Ubuntu is now up and running!
Set Ubuntu to use with WSL2
Open a powershell terminal in admin mode:
wsl --set-version Ubuntu-18.04 2
hint: with wsl -l you can see all distro’s installed on your system
Update Ubuntu
Execute the following statement in your Ubuntu terminal to update it:
sudo apt-get update && sudo apt-get -f install && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoclean && sudo apt-get autoremove
Install Docker in Windows
Install the edge version of Docker Desktop for Windows (make sure to install the update as well).
Enable the WSL2 engine:
Select the Ubuntu installation as a resource to use with WSL2:
Press “Apply & Restart”.
Back to option 1
Repeat only the following steps from option 1. The disk and memory settings can be skipped since WSL2 provides all available resources to Ubuntu.
In folder sap-nw-abap-trial-docker execute:
docker run --privileged -p 8000:8000 -p 44300:44300 -p 3300:3300 -p 3200:3200 -h vhcalnplci --name nwabap752 -it nwabap:7.52 /bin/bash
After executing this statement, you will get an error: ‘image not found’. In order to solve it, you will have to make the image first by running this statement:
docker image build -t nwabap:7.52 .
Now repeat the initial command and the container will automatically start:
docker run --privileged -p 8000:8000 -p 44300:44300 -p 3300:3300 -p 3200:3200 -h vhcalnplci --name nwabap752 -it nwabap:7.52 /bin/bash
You can see that it’s running in Docker:
Now you are able to install the SAP NW 7.52 system in the Docker container as seen in option 1.
Option 3
Follow the instructions as written in option 2 up to the step “install Docker Desktop for Windows” in order to run Docker without Docker Desktop for Windows.
To get your files in Ubuntu you can copy them using the following mount point:
cd /mnt/c/Users/bart/Downloads
Now go to option 1 and follow the instructions starting from step 6.
Some remarks
Docker Desktop for Windows uses Hyper-V to run the containers, while Docker Desktop for Windows with a WSL2 backend runs the containers in Ubuntu itself.
While playing around with WSL I noticed a remarkable improvement in performance between version 1 and 2.
The end?
Have fun with your local SAP system in a Docker container!
Sources
https://docs.microsoft.com/en-us/windows/wsl/wsl2-install
https://docs.docker.com/docker-for-windows/wsl-tech-preview/
https://hub.docker.com/editions/community/docker-ce-desktop-windows
https://engineering.docker.com/2019/06/docker-hearts-wsl-2/
https://github.com/nzamani/sap-nw-abap-trial-docker
Please leave your suggestions, improvements and comments below!
Greetings
Bart
Just one remark:
WSL 2 switched the approach completely and does not use a custom syscall translation layer anymore and instead does rely completely on Hyper-V.
… which runs on Hyper-V
https://docs.microsoft.com/en-us/windows/wsl/wsl2-about#brief-overview-of-the-wsl-2-architecture
https://docs.microsoft.com/en-us/windows/wsl/wsl2-faq#does-wsl-2-use-hyper-v-will-it-be-available-on-windows-10-home
Thanks for pointing that out Fabian Lupa!
Gents,
good ideas, but having been through 2 recent BSOD crashes i would not risk this 'linux inside' virtualization on my main Windoz machine. i have also spent $100 to go from Home to Pro, so when WSL 2 comes out on Home it will make me even less excited about my investment.
your experience may differ, so have fun, i guess.
cheers, gm
Hi,
I tried to install SAP ABAP 7.52SP02 trail version following above option 2,
But getting the error "Please check free disk space" even though I increased the docker partition size to 500GB, Kindly help me to fix this issue.
Thanks - Sai
Hi Sai
Is there enough disk space on your computer?
I suggest that you try the new 1909 developer edition https://blogs.sap.com/2021/02/15/sap-abap-platform-1909-developer-edition-available-soon/
Kind regards
Bart
Hi Bart,
I am trying to install a trial version on Windows 10 Home edition with 8GB RAM configuration, but for 1909 docker image required 16GB RAM. So I have chosen the above approach.
And I have enough space on my computer. Still, I am getting the above error.