Technical Articles
Installing NetWeaver AS ABAP 7.52 SP 01 Developer Edition with Vagrant and Ubuntu
Recently AS ABAP 7.52 dev edition has been released. There are quite a lot of articles how to install it with virtual box and docker. However, I haven’t seen any blog on how to do it with Vagrant and Ubuntu. The only vagrant config I found was this. Also most of blog posts use OpenSUSE. So I decided to add some diversity.
This is yet another guide on how to easily install NW dev edition. This time with Vagrant which make it really easy and automatic. First a few theoretical explanations and disclaimers.
UPD 2019-01-26: the provisioning scripts now install sapnw as a systemd service so it should autostart at boot time. See details in the repository readme.
UPD 2019-10-19: the script also works with the newest AS ABAP 752 SP04, developer edition. The latest script updates also have an option to automatically install abapGit, see my other blog post on this subject and the youtube video đ
What is vagrant
It is a tool to setup virtual environments conveniently which is quite popular for deployments in other dev environments. No need to go through boring installation process which is a plus. Basic virtual machine is created within seconds (for popular flavors that exist in vagrant cloud repository).
Why not docker? (IMHO, arguable)
- Ideologically docker is supposed to be stateless. Databases should be in volumes, not inside docker layer
- Besides, docker storage layer is slower than volumes
Note: to be objective, this is not a terrible obstacle. I think /sybase directory can be mounted to a volume, logs and transports also… Just might need some more effort to make it properly with docker.
Why Ubuntu
1) Ubuntu is very popular linux flavor. The community is huge and there are a lot of materials on how to solve this or that issue
2) Bare Ubuntu server is small and just ~1 GB in size
3) … and yes, I know Ubuntu better, which might be the main reason đ
Installation
OK, enough of theory, let’s go through installation. First check the official blog post about the installation, in particular for hardware requirements – https://blogs.sap.com/2018/09/13/as-abap-7.52-sp01-developer-edition-concise-installation-guide/.
To install you will need:
- installed virtual box
- installed vagrant, on Windows 7 vagrant will ask for powershell 3. You get it here if needed
- download this repository from github – https://github.com/sbcgua/sap-nw-abap-vagrant. You can either download it as zip or with git – ‘git clone https://github.com/sbcgua/sap-nw-abap-vagrant.git’
- download NW752 distribution and uncompress (!) it to ‘distrib’ folder of the cloned repository
- open cmd or powershell in the cloned directory
- run ‘vagrant up’
- wait for installation to finish … (took ~1-1.5 hours on my laptop)
- That’s it, no more manual install actions ! Vagrant will do all the rest. The final fresh VM weight just around 40 GB.
After this you can connect to the instance (127.0.0.1) and continue with post-installation steps as described in main guides. No need to configure forwarding ports it is already done by Vagrant. What you actually get as the result is ready to use VM in Virtualbox.
How to use
- To start VM
- run cmd in the Vagrantfile directory
- start vm with ‘vagrant up’ (this will detect that the machine was already provisioned and just start it)
- run ‘vagrant ssh -c startsap.sh’ to run instance
- To stop machine
- run cmd in the Vagrantfile directory
- run ‘vagrant ssh -c stopsap.sh’
- run ‘vagrant halt’
- Note: start/stopsap.sh are a shortcut scripts installed by the Vagrant config, they are not real start/stopsap. To run commands inside you have to login to the VM with ‘vagrant ssh’ and then run ‘sudo su -l npladm’ to switch to sap admin user
Alternatively, you can address it just by name from any location (e.g. by running cmd with Win+R). For this check VM status with ‘vagrant global-status’ and then run ‘vagrant up sapnw‘ and ‘vagrant ssh sapnw …’ where sapnw is the VM name.
Yet more alternatively you can run VM directly from virtual box, Vagrant did it’s job by now and now it is just a convenient option.
Have a look at the repo README for some additional details. In particular there is some consideration regarding memory – the current config create VM with 6GB of RAM. You can optionally decrease it to 4GB + enable swap (just uncomment a couple of lines in Vagrantfile). This worked for me, however this is under the official recommendations so should not be considered as the best practice. To configure more than 6GB – change value for ‘vb.memory =’ param in Vagrantfile (before the installation).
I hope you find this useful !
P.S. For those who doesn’t want to use Vagrant but want to use Ubuntu – you can check ‘scripts’ folder in the repo dir to figure out main command sequence.
Excellent blog.
Never heard of Vagrant before but looks pretty interesting.
Definitely worth to check.
J.
Sorry sir, do i have to install ubuntu on virtualbox first? Or is it automatically configured by vargant? Thank you
No, it is installed automatically by vagrant. Vagrantfile has `config.vm.box` parameter which defined the base image. It is âubuntu/xenial64â for the moment. So Vargrant knows which image to download. For info: âubuntu/xenial64â is a image published (and regularly updated) by Ubuntu themselves. You can find it here - https://app.vagrantup.com/boxes/search
Â
I get this message error on 2nd day on running starting sap script. Hope this would be some user-mistakeÂ
vagrant@127.0.0.1: Permission denied (publickey).
Â
Seems like some error with vagrant itself or it's metadata. Did you occasionally delete the folder with Vagrantfile ? Upon first start vagrant generates a unique ssh key for the machine and keeps it near the config file (as well as some other meta). So if you delete the folder the ssh key may also be deleted. This is first what comes to my mind.
Alternatively just google the error message, there are quite some links to check. E.g. check this and this. It is generic vagrant mistake, not sap related.
I think vagrant has done its job, i can start, stop sap after logging in to vm. I don't remember exactly I cleaned for space, but it looks an ongoing issue with win10 users mostly.
I m facing an issue when i run vagrant up. Can you please help me how to proceed.
sapnw: Get:7 http://archive.ubuntu.com/ubuntu xenial/universe amd64 mc-data all 3:4.8.15-2 [1,202 kB]
sapnw: Get:8 http://archive.ubuntu.com/ubuntu xenial/universe amd64 mc amd64 3:4.8.15-2 [462 kB]
sapnw: Get:9 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 unrar amd64 1:5.3.2-1+deb9u1build0.16.04.1 [123 kB]
sapnw: dpkg-preconfigure: unable to re-open stdin: No such file or directory
sapnw: Fetched 3,215 kB in 9s (340 kB/s)
sapnw: Selecting previously unselected package csh.
sapnw: (Reading database ...
sapnw: (Reading database ... 5%
sapnw: (Reading database ... 10%
sapnw: (Reading database ... 15%
sapnw: (Reading database ... 20%
sapnw: (Reading database ... 25%
sapnw: (Reading database ... 30%
sapnw: (Reading database ... 35%
sapnw: (Reading database ... 40%
sapnw: (Reading database ... 45%
sapnw: (Reading database ... 50%
sapnw: (Reading database ... 55%
sapnw: (Reading database ... 60%
sapnw: (Reading database ... 65%
sapnw: (Reading database ... 70%
sapnw: (Reading database ... 75%
sapnw: (Reading database ... 80%
sapnw: (Reading database ... 85%
sapnw: (Reading database ... 90%
sapnw: (Reading database ... 95%
sapnw: (Reading database ... 100%
sapnw: (Reading database ...
sapnw: 54196 files and directories currently installed.)
sapnw: Preparing to unpack .../csh_20110502-2.1ubuntu1_amd64.deb ...
sapnw: Unpacking csh (20110502-2.1ubuntu1) ...
sapnw: Selecting previously unselected package libtcl8.6:amd64.
sapnw: Preparing to unpack .../libtcl8.6_8.6.5+dfsg-2_amd64.deb ...
sapnw: Unpacking libtcl8.6:amd64 (8.6.5+dfsg-2) ...
sapnw: Selecting previously unselected package tcl-expect:amd64.
sapnw: Preparing to unpack .../tcl-expect_5.45-7_amd64.deb ...
sapnw: Unpacking tcl-expect:amd64 (5.45-7) ...
sapnw: Selecting previously unselected package expect.
sapnw: Preparing to unpack .../expect_5.45-7_amd64.deb ...
sapnw: Unpacking expect (5.45-7) ...
sapnw: Selecting previously unselected package libaio1:amd64.
sapnw: Preparing to unpack .../libaio1_0.3.110-2_amd64.deb ...
sapnw: Unpacking libaio1:amd64 (0.3.110-2) ...
sapnw: Selecting previously unselected package libssh2-1:amd64.
sapnw: Preparing to unpack .../libssh2-1_1.5.0-2ubuntu0.1_amd64.deb ...
sapnw: Unpacking libssh2-1:amd64 (1.5.0-2ubuntu0.1) ...
sapnw: Selecting previously unselected package mc-data.
sapnw: Preparing to unpack .../mc-data_3%3a4.8.15-2_all.deb ...
sapnw: Unpacking mc-data (3:4.8.15-2) ...
sapnw: Selecting previously unselected package mc.
sapnw: Preparing to unpack .../mc_3%3a4.8.15-2_amd64.deb ...
sapnw: Unpacking mc (3:4.8.15-2) ...
sapnw: Selecting previously unselected package unrar.
sapnw: Preparing to unpack .../unrar_1%3a5.3.2-1+deb9u1build0.16.04.1_amd64.deb ...
sapnw: Unpacking unrar (1:5.3.2-1+deb9u1build0.16.04.1) ...
sapnw: Processing triggers for man-db (2.7.5-1) ...
sapnw: Processing triggers for libc-bin (2.23-0ubuntu10) ...
sapnw: Processing triggers for mime-support (3.59ubuntu1) ...
sapnw: Setting up csh (20110502-2.1ubuntu1) ...
sapnw: update-alternatives: using /bin/bsd-csh to provide /bin/csh (csh) in auto mode
sapnw: Setting up libtcl8.6:amd64 (8.6.5+dfsg-2) ...
sapnw: Setting up tcl-expect:amd64 (5.45-7) ...
sapnw: Setting up expect (5.45-7) ...
sapnw: Setting up libaio1:amd64 (0.3.110-2) ...
sapnw: Setting up libssh2-1:amd64 (1.5.0-2ubuntu0.1) ...
sapnw: Setting up mc-data (3:4.8.15-2) ...
sapnw: Setting up mc (3:4.8.15-2) ...
sapnw: Setting up unrar (1:5.3.2-1+deb9u1build0.16.04.1) ...
sapnw: update-alternatives: using /usr/bin/unrar-nonfree to provide /usr/bin/unrar (unrar) in auto mode
sapnw: Processing triggers for libc-bin (2.23-0ubuntu10) ...
==> sapnw: Running provisioner: shell...
sapnw: Running: C:/Users/mahes/AppData/Local/Temp/vagrant-shell20190127-11192-1bw4l0r.sh
sapnw: Local start/stopsap scripts...
sapnw: Installing service...
sapnw: Created symlink from /etc/systemd/system/multi-user.target.wants/sapnw.service to /etc/systemd/system/sapnw.service.
sapnw: â sapnw.service - SAP NW server
sapnw: Loaded: loaded (/etc/systemd/system/sapnw.service; enabled; vendor preset: enabled)
sapnw: Active: inactive (dead)
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
Hi Madhuri,
Sorry didn't see your question. there was a recent update to the repo which installs sapnw as a service, maybe it brought this issue. Please try the latest version of the repo. If does not work:
Hi Alexander,
first of all thanks for this blog.
It was a pleasure to install NW with your instruction and all without any trouble.
My installation was succesful, starting the NW System is also fine but when enter the System via GUI as developer and calling SE80 for example (also the same for other transactions) i'm getting the error
âRoll in failed; ABAP session terminatedâ
My first research results in something with wrong memory parameter settings inside the NW. But as i canât access any transaction, i canât check anything.
I also started to search commands to change this kind of settings over the command shell, but w/o any success.
Do you have any ideas?
Â
Hi Eugen,
Haven't met issue like this, despite of several installations so far, sorry đ
Don't know what to suggest. In terms of VM - just check that you have at least 6GB of RAM for the VM - this definitely works for me, and I didn't test my 4GB version a lot (just in a case you adjusted the vagrant config manually - 6GB is the default).
Hi Alexander,
thanks for your reply.
I installed the system again but this time i made two changes before:
First, i changed the memory size inside the Vagrantfile to 8 GB (as you proposed)
Second, inside the fille "install.sh" of the NW installation folder i found a parameter so called "PHYS_MEMSIZE" which was set up to 2 GB. I increased it to 6 GB. As i read in different posts, this parameter specifies the amount of main memory to be used by SAP instance. So maybe 2 GB was to less.
Now the system runs well and the issue, i mentioned in my first commet, is gone. Unfortunately i don't now which of this parameters helped đ
Thanks again for this blog.
Cheers
Eugen
hello,, can i know what is the preset username and password of vhcalnplci in the ubuntu? can't log in or where can i find it?
Not sure if you've found the answer but the master installation password is 'SapPwd1!'. You can find this in the directory scripts > provision and in the file install_nw.expect.
Hello,
many thanks for this shortcut. On a linux host I had to change line 2 in the script
install_nw.expect
#!/usr/bin/expect -f
spawn /vagrant/distrib/install.sh -s -k
with
spawn /install.sh
install.sh was not found.
Maybe this is useful for other linux users
Thanks again
Kind regards
Matthias
Hi Alexander,
My installation has been stuck for more than 5 hours at this :
Do you have any idea of what could be the problem? Thank you.
I follow eugenâs step above, changed the memory size inside the Vagrantfile to 8 GB and parameter âPHYS_MEMSIZEâ in file install.sh to 6 GB.
And the installation was successful, done in 20 minutes only.
Thank you