This blog explains how you can get an SAP NetWeaver 7.51 SP02 Developer Edition running on an Ubuntu virtual machine. We illustrate using hosts running mac OS (High Sierra) or Windows 10, and using two free hypervisors: Oracle VirtualBox, and VMWare Workstation Player. [Tested 7.52 NetWeaver ok also using this blog’s instructions].
If you like, you can view this blog as the “Ubuntu sibling” of the official SAP blog for installing on openSUSE VM: https://blogs.sap.com/2017/09/04/newbies-guide-installing-abap-as-751-sp02-on-linux/
There are quite a few differences to take into account when installing on Ubuntu, which I found using the usual iterative methodology: “try… fail… say something rude to the computer… try something else… fail… “
Before we go through the many steps of this How-To … here is what my screen looked like one afternoon at Stockholm-Arlanda airport, while waiting for the flight to Helsinki… the first successful Ubuntu SAP NetWeaver installation has just occurred (ummm, first time it occurred on any of my machines, certainly not the first time this installation has ever happened in the world)… the hypervisor was VirtualBox, running on Mac OS (High Sierra):
Hurray!! Later in the evening, the minor tasks needed to make it accessible via SAPGUI for Java, and installation of the developer license via SLICENSE, completed ok:
Let’s make this kind of state of the world – SAP NetWeaver running nicely on an Ubuntu VM – our nerd-goal in this blog! Read on (if you like) …
So, the steps are as follows:
Register for an SAP NW751 SP02 Developer Edition (or whatever is the most current edition, this was the newest one in March 2018). https://blogs.sap.com/2017/09/04/sap-as-abap-751-sp02-developer-edition-to-download/
Download the set of rar files that are accessible from the email link that SAP send you after you have registered for a Free Trial copy.
If needed, download and install a tool that can extract multipart rar files, which tool you need depends on whether you intend to do the unpacking on the host machine or in the VM itself (see below for more details on those two options). (Mac: e.g. The Unarchiver – https://theunarchiver.com/ ; Ubuntu: sudo apt install rar unrar ).
Download and install a hypervisor, VirtualBox and/or VMware Workstation Player. https://www.virtualbox.org/
Oracle VirtualBox is available for Windows, Mac, and Linux; VMWare Workstation Player available for Windows and Linux (if you are running a non-virtual Ubuntu distro, you can of course choose to just install NetWeaver without using a hypervisor, if you like). Anyway the examples in this blog are done using VirtualBox on mac OS (High Sierra) and VMWare Workstation Player on Windows 10).
Install the new Ubuntu VM (the latest LTS version, e.g. in March 2018 we would use the version LTS 16.04.4; you can download the .iso from https://ubuntu.com/desktop ), so yes, install a new Ubuntu VM into the hypervisor: (screenshots are taken from an Ubuntu install on VirtualBox on a MacMini; VMWare Player has a similar GUI-based process (not shown in this blog) to create a VM from an image).
UPDATE June 2018: this blog used Ubuntu 16.04.4, in June I tested Ubuntu 18.04 – installation succeeds, but see my blog about the need (at the time) to modify the install.sh script, when using Ubuntu 18.04, which does not come with ‘ifconfig’ tool pre-installed:
[Selected New… then “Expert Mode”…]:
I used VHD in these examples, other virtual disk formats should also work. Allocate at least 5GB of RAM (more is better, but in above example only 8GB RAM on the host so 5 or 6GB is a practical maximum for guest VM to use…if you have a machine with available RAM for guest VM of 4GB or less, it is unlikely you can follow this tutorial using that machine); then give the VM around 100GB of storage space (though e.g. 80GB may be enough). When you Power On, you will be asked to specify a boot-disk, we give the path to our Ubuntu .iso file:
When the actual Ubuntu installation process starts, I chose not to use Logical Volumes (anyway with VirtualBox you have snapshots available from the hypervisor); selected option “Download with updates” as it reduces the amount of time spent doing updates later; language English US (default – do not change!); keyboard, well that depends on what keyboard you have, for example for standard Finnish keyboards I selected Finnish → Finnish, on MacBook Pro and MacMini used Finnish → Finnish (Macintosh).
As part of the installation, it is a good idea to already give your computer the hostname: vhcalnplci
(That saves you having to change it later, since that is the hostname favoured by the Developer Edition installer, although if you are reasonable in naming choices other hostnames are ok, tested this).
… you need an OS user (in this example, “marmot”; in other examples screenshotted in this blog, the OS user might be called something else, e.g. “dylan” or “murmeister” or whatever); and why not call your computer “vhcalnplci” since rolling your own name can lead you into dark areas of error log messages 🙂
After installing, a popup asks you to Restart to finish setup… You will be asked to “remove the installation media, and press Enter”, just press Enter and the machine will power off, and hopefully boot up again.
Now you can open a terminal, from the Dash-icon in top left and with a search string, then click on the icon for Terminal
(If you are shown as user “ubuntu” then you are still working off the “CD-trial-instance”, and so you still need to shutdown the VM to finish the installation, and power on to log on as your actual newly created OS user).
So the state of play should be that you have a Terminal window open, and it should show that it is indeed you who is there, ready to continue this installation adventure…
Commands to run on login:
sudo apt update #updates the package repositories. Note that if e.g. Ubuntu Software Updater is also silently checking the “update-status” (e.g. just after logon) and thus locking the package management tools, then you might get an error message when trying to use the “apt”-utility…
if so, get coffee, come back it should work after a few minutes, or at least Software Updater should be informing you that it wants to install updates. You could also use Software Updater, which is basically a GUI-wrapper application for executing the update and upgrade commands then informing you whether you need to restart to finish the upgrade process.
sudo apt upgrade #upgrades the actual packages with newer versions. Hit <Enter> or “Y” to answer any “upgrade this?” questions that may come up.
sudo reboot now #quite often needed just after “initial” apt upgrades
sudo apt install terminator #(optional) an arguably neater command terminal than the standard Ubuntu terminal, in case you are into that kind of thing
sudo apt install tree #(optional) tree is a neat way for viewing directory structures from a terminal
sudo ufw status #the basic Ubuntu firewall should be in status inactive, e.g.:
(If not inactive, you can inactivate it using: sudo ufw disable )
Next, we need to set up a shared folder, so a folder on the host machine that is accessible by the Ubuntu VM, or in Linux/Unix jargon, the host folder is mounted on the Ubuntu filesystem. This works slightly differently according to which host OS and which hypervisor you are using, but mostly the differences are to do with the hypervisor, so we will describe for VirtualBox (mac OS), and for VMWare Player (Windows 10).
Menu path: Devices -> Insert Guest Additions CD image… and press the “Run” button:
Authenticate (your OS user’s password needed, in order to sudo):
If you get an error about failing to build kernel modules because you need to install gcc make perl packages, install these, then navigate using the Files app to the CD and run the Guest Additions CD again. So the command to install those packages is:
sudo apt install gcc make perl
A tidy one-liner. Anyway, you arrive at something like this:
So it looks as if the Guest Additions install goes a bit wrong, but actually, it should all work fine, after reboot… so once you get the “Press Return to close this window“ output, you can press <Enter> (i.e. <Return>) and then you reboot the VM. However you might get stuck with this error message, which is basically saying that the Guest Additions aren’t working properly, but of course saying it in some kind of Linux-jargon:
I fixed it by running (from the Dash-icon) Software Updater, which identified a few more packages to be updated, installed those, and told me to Restart the computer to complete the update. So I did, after that the xmessage error did not occur anymore and the shared folder was visible. If that doesn’t work for you, there is a workaround available here, give it a try:
Now in this example, I have the rar files in a folder on the host machine called “netweaver”, and then in a subfolder I have already unpacked the rar files (in this case using The Unarchiver). If you want to copy across the rar files themselves into the VM and unpack them inside Ubuntu, see advice on that below. In this example, we instead make the directory of unpacked files available to Ubuntu’s filesystem. So, we set up our shared folder according to that logic. Machine -> Settings -> Shared folders; click “Add folder”, then select the folder from host:
Checkboxes ON for: “Auto-mount”, and “Make permanent”. Give the folder a sensible name for Ubuntu to understand later… Then press OK-button.
Then we need to reboot the computer. And check from inside Ubuntu that we can access this folder …
Since I gave it the folder name “nw-unpacked”, then it gets mounted in the Ubuntu filesystem at /media/sf_nw-unpacked/
Using the Nautilus “Filesystem GUI” as your non-super-user, you will not be able to open the shared folder. But you can view its contents using a terminal and of course the sudo magic potion:
So, the files are all owned by the root user (which is why you need “sudo” to list them), and any members of group “vboxsf” also have full permissions. So you could make yourself a member of group “vboxsf”, or we can just keep using sudo. Epiphenomenally, let’s mention that the tree-command is good in case you want to view the directory structure at “-L n” levels of the hierarchy:
Next, we look at VMware and its Linux Guest Additions: …
And here is the official help article from VMWare, in case you need that:
It might be a good idea to eject the Ubuntu installation disk first from the (virtual) CD/DVD drive, so that you can “play” the VMWare Tools virtual CD, so first press the “Eject” icon:
Then the Manage -> Install VMware Tools… menu-command should work, so you see them in the virtual DVD-drive:
Now you can extract the tools e.g. to your home directory using right-click on the zip, Extract To -> Choose Other location e.g. ~/vmwaretools-local (Create the new subdirectory as you go along). Or we dig out a terminal and sudo make-me-a-sandwich ( https://imgs.xkcd.com/comics/sandwich.png ). Either way you end up with something like this:
So then you can switch to that directory and run the installer sudo ./vmware-install.pl with default answers to script’s questions, except that we answer the first question with “yes” (we want to install the Guest additions): if our Ubuntu installation already contains open-vm-tools, so that is nice… but probably we should still run these config-tools… first run the installer, and that will probably also run the config tools for us (if we answered the first question as “yes”), but if not then change to directory ./bin/ and run the config script from there.
Then… shutdown (Power Off) the VM. (Either use the menu bar, or in terminal: sudo shutdown now ).
For the Ubuntu VM, from the “Management Screen” choose “Edit virtual settings”, or choose menu path Player -> Manage -> Virtual Machine Settings, or choose Ctrl-D.
Then from Options tab, Shared folders – change to “Always enabled”. Then click “Add…” and use the wizard to add and name the shared folder. So for example I call it “nw-unpacked” for an unpacked (from rar) set of files:
Restart your Ubuntu VM, and the shared folder should be visible, mounted in the filesystem at /mnt/hgfs (hgfs – probably an acronym meaning “host-guest-file-system” … I am guessing yeh).
If not visible, try running the vmware-config-tools.pl script again, from the bin subdirectory:
You can also check (if you have the VMware tools installed) for Ubuntu’s new “insider host-like knowledge” about the mounted filesystem (i.e. shared folder) using the command: vmware-hgfsclient
Now the shared folder is owned by root (you can check this using ls -l ). We can uproot ourselves a bit later to become root, sudo -i and then we can use the files in this shared folder ok…well I am not sure if that is good practice, but it will make it easier to operate inside that shared folder. First though, we need to install some more stuff in the Ubuntu VM.
So anyway, that was enough about the shared folders and the different ways of setting them up, now we start doing hypervisor-neutral config again i.e. stuff you need to do in Ubuntu, independently of which hypervisor you are using.
More terminal commands:
sudo apt install csh #the C-shell, needed for the install of NetWeaver to work. You can check whether this shell is available by looking at the contents of /etc/shells :
sudo apt search libaio #this libaio is needed, but unlike say with installing MySQL, we cannot expect the SAP installer to have included such a library for convenience. Now there is no package for Ubuntu called libaio, so you need to search for it, hence this “apt search” 🙂 Typical output is:
sudo apt install libaio1 #So we just want the nice standard implementation, which in this case is package libaio1
sudo apt install uuid #this is needed for generating unique id numbers. When installed, it is not automatically switched on (not in active-running state), I switched it on anyway but after any reboot you may need to repeat this step, anyway command to activate is sudo systemctl start uuidd
cat /etc/default/locale #check that LANG=”en_US.UTF-8”, that is the default and is needed by the NW-installer as OS language. If something else, try changing and reboot, e.g. sudo nano /etc/default/locale and recheck
ifconfig #You need to find out your (relevant) IP address, on a VMWare adapter network it will be something like 192.168.48.129 , on a VirtualBox adapter network it will be something like 10.0.2.15. On Ubuntu 18.04, better to use: ip addr show
sudo nano /etc/hosts #comment out the line mapping the Ubuntu loopback IP 127.0.1.1 to vhcalnplci, and add the line mapping your network IP address to the short name and FQDN of your ubuntu VM. Short name is: vhcalnplci , and FQDN is: vhcalnplci.dummy.nodomain – in nano, use the Ctrl-O command to save changes, and Ctrl-X to exit. Then cat /etc/hosts to check results, it should look something like this:
sudo reboot now #reboot. (Good idea after reboot to check using ifconfig that your IP address has not changed!).
sudo systemctl start uuidd #start up the uuidd (the 2nd “d” probably refers to be the “daemon” of uuid).
systemctl status uuidd #should be up and running, like this:
(Use the letter ‘q’ to exit from the “service-report” back to the user-command-ready state of the terminal).
At this point, if you are using VirtualBox, it is a good idea to take a snapshot of the VM, in case the later steps which are closer to the “actual installation of NetWeaver instance” fail, you can revert back to this pre-NetWeaver-install state. So (mac OS or Windows), use menu-path Machine -> Take snapshot… , and afterwards you can view your snapshots from the management screen under Machine Tools -> Snapshots:
So-ohhhhhh… now it is time to become the root user:
And we cd into the shared folder, which depending on which hypervisor you configured, is either at /media/sf_yourfoldername/ (VirtualBox) or at /mnt/hgfs/yourfoldername e.g. :
cd /mnt/hgfs/nw-unpacked/ or: cd /media/sf_nw-unpacked/
If the install script has not been made into an executable, then we can fix that using:
chmod +x install.sh
And then we press go… ok just joking, there is no “press go” button in the terminal, so instead:
If you get a warning about missing packages, write “yes” then press Enter, to let Ubuntu handle getting these missing packages:
Or if you prefer, you can say no, cancel the install.sh processing, and manually call:
sudo apt install libc6 libstdc++6
… anyway once the install.sh gets started, you need to scroll down (use “Enter” through all the license agreement for a while, then answer “yes” to “Do you agree to the above license terms? yes/no” question… then you have to specify a password which will be given to the “SAP OS users” (such as “npladm”), and if everything goes well, then about 20 minutes till an hour-and-a-half later (depending on various things, but mostly on the number of processors your VM has and the amount of RAM it has), you have an SAP NetWeaver system up and running in your VM.
If you get the “Installation of NPL successful” message, then congratulations.
(If the installation fails, then you will need to look around on the various internet forums and so on to troubleshoot that, unfortunately or rather fortunately I have not been able to replicate all the failure cases I have read about on the SAP community pages and elsewhere, nor am I clever enough to invent all workarounds. If you have a VirtualBox snapshot from just before installation phase, then that gives you better chances to try different workarounds from the same “about to install”-state).
So if installation was successful, next step is to become the SAP OS user “npladm”, command: su -l npladm (then enter the npladm user’s password). Then you can execute the basic “healthcheck command” of sapcontrol utility. Note that npladm uses the C-shell (“/bin/csh”):
We aim our healthcheck at the instance 00: sapcontrol -nr 00 -function GetProcessList
Which was nice!
If not all 4 instance 00 processes have status green, this can often be solved as follows (as npladm user):
Another installation-option (in computing, and maybe especially in Linux and Unix, there are usually different ways to get something done), is to copy the rar files into the VM itself, and unpack them from inside the VM… that will take up say 15GB of your 100GB, but as an anecdotal aside of low interest to most readers, that was the way I chose, the first time I got the NetWeaver installation procedure to work on Ubuntu.
E.g. copy the rar files (still as rar files) to e.g. /home/<my-os-user>/nw-local/ or similar so in the shared folder, if you were OS user marmot, you would (su)do:
sudo cp -a rarfolder/. /home/marmot/nw-local/
And unpack the rar files there in the local subdirectory. First, we need a tool to unpack stuff:
sudo apt install unrar rar
Then the GUI-based Archive Manager knows how to unrar the files, just use it like normal. Or you can use the terminal if you like. Anyway you should end up with the unpacked files in the local directory.
And set the sudo chmod +x install.sh there. And then sudo ./install.sh from the local folder. Worked for me (in the airport departure area).
So, all that is left to do is to get it working with SAPGUI, HTTP, and so on… so the port forwarding, it works differently depending on which hypervisor you are using…
For VirtualBox, follow the advice from the main blog here, on setting up the needed Port Forwarding configuration for your VM:
You should end up with something that looks like this:
Now for the Windows 10 and VMWare case… so, the network adapters that come with VMWare Workstation Player, are quite clever, so we can just use those adapters and the IP address that the Ubuntu VM has on the VMNet adapter (in your VM, use the command ifconfig or ip addr show to see this address).
So, it is enough to set up a new SAPGUI Connection Entry, knowing that on VMnet8 our VM has, say, IP address 192.168.48.131 (you may not be able to ping it from host machine without some tricks, as it is not set up to allow ICMP by default, but don’t worry about that, just try using the IP address in SAPGUI config), e.g.:
If you are running SAPGUI for Java and VirtualBox, e.g. on a Unix or Linux host machine, then connection config is simple, since in VirtualBox you did the Port Forwarding mapping already:
(This blog is not going to go into the details of how to set up Java and SAPGUI clients and so on, for that you can search the Internet including SAP Community pages for tutorials).
So now we can logon ok… (use the Default password (in the readme file somewhere) e.g. for default user “Developer”):
(Interesting to note that the official “Kernel Compilation” is for “Linux GNU SLES-11 x86_64 cc4.8.5 use-pr170509”, but hey, that is nice, that although the target VM is from the Debian distro-branches, everything seems to work using this SUSE-focused compilation).
From this link:
… you find info about renewing abap license (in client 000 with user SAP*). Once you have the hardware key from tcode SLICENSE (client 000, login as user=SAP* ), you then go to:
The “NPL.txt” file that you download, is what you then upload as the new license key into SLICENSE of client 000 – remember to delete the temp license before uploading the new one.
After that you can log in to client 001 as user=Developer, and do your SAP programming or whatever it is that you want to do in the NetWeaver box:
Once you have logged off, you can pause the VM (don’t just shut it down!), and resume the VM next time you want to use the NetWeaver box.
If you ever want to shut down the VM (e.g. after Ubuntu kernel updates), then:
(as OS user npladm): stopsap ALL
and wait for all the sap stuff to stop. Or, if you like to do things the long way round, there is this other way also:
sapcontrol -nr 00 -function StopSystem ALL
Check that nothing belonging to the sapcontrol Process List is running, using:
sapcontrol -nr 00 -function GetProcessList
AND: sapcontrol -nr 01 -function GetProcessList
(the instance number 01 has the NetWeaver Message Server and NetWeaver Enqueue Server).
If anything shows “GREEN” or “YELLOW” or any status other than “GRAY” then there is still stuff stopping, so wait until everything is a uniform grey status.
Once everything is stopped, then you can logout e.g. command: exit from being OS user root or OS user npladm etc, and shut down the Ubuntu VM (e.g. via GUI, or as your own OS user: sudo shutdown now ).
When you reboot, there are 2 ways you can get your NetWeaver instance up and running again… one way is quite easy, the other is a bit tricky…
The first way is for npladm ( su -l npladm ) to say:
This should work 🙂
The second way, it’s maybe pointlessly difficult compared to the first way, but since I used it up until I realised that startsap ALL would work, so just in case anyone else wants to do things the hard way:
You will want to activate the UUIDD daemon again (as your OS user: sudo systemctl start uuidd && systemctl status uuidd ), and then start up the SAP server again (as OS npladm).
This probably won’t work on your Ubuntu VM (though it works on the openSUSE variant of this installation):
sapcontrol -nr 00 -function StartSystem ALL
If you get an error “FAIL: NIECONN_REFUSED (connection refused) ….” then the solution is here:
So for example, as OS user npladm, I changed directory to /usr/sap/hostctrl/exe directory (which contains the executable file called sapstartsrv)
cd /usr/sap/hostctrl/exe/ … and then ran the command:
./sapstartsrv pf=/sapmnt/NPL/profile/NPL_D00_vhcalnplci …so here we assign the “start profile for instance NPL (D00 (instance number 00)) running on host vhcalnplci;
also, we must assign the start profile for the ASCS01 (instance number 01, the Abap Central Services instance)), like so:
Now you can (maybe in another window) as OS user npladm move back to the /home/npladm directory (optional, but generally I like to stay at home unless there is a good excuse to go hillwalking in the Unix filesystem). Now if you run, say, the GetProcessList command, it should provide some non-error information:
So, now you can finally get started, with that command:
sapcontrol -nr 00 -function StartSystem ALL
This time it should work ok.
Again, wait for all “GREEN” statuses from
sapcontrol -nr 01 -function GetProcessList
sapcontrol -nr 00 -function GetProcessList
[The instance 01 will actually start up first, as it has components that the “main” instance 00 knows it needs. But you don’t need to worry about that, though if you like you can go read about the internals e.g. from some of the better SAP Press books, or google it, etc].
After all statuses are showing GREEN, then you can logon to your SAP instance again, here for example the SAP user has gone to tcode SM51, looks fine:
quod erat demonstrandum, etcetera etcetera. Any mistakes or suggestions for improvement, feel free to comment.
Ubuntu 18.04 LTS was released soon after this blog (using 16.04 LTS) was published, so-oh … UPDATE June 2018: tested Ubuntu 18.04, installs ok, but see my blog about dealing with the differences in how to handle ‘ifconfig’:
References (like during most of my hobbyist “mini-projects”, there were many useful websites including https://stackoverflow.com/ and https://askubuntu.com/ visited; below is just a more “official” subset of relevant sites):
– main blog for nw 751. Links to:
Also, the main blog has a link to the SAPstore for the actual rar files (first you fill in a form, then you get an email link, valid for 48 hours; check you are getting the latest NW version e.g. if you want 7.51, don’t register for 7.50));
Also a link to the new ASE license needed from April 2018 (not mentioned in the blog, but worth having a valid license and easy enough to replace the old one):
– for the 7.50 edition, notes the need for: csh, uuidd, and libaio
– interesting blog by SAP guy and Linux enthusiast
– older blog, with some people noting a modlib error, my guess is that the root cause was not having libaio1 installed.