<

Go Premium for a chance to win a PS4. Enter to Win

x

Installing SQL Server vNext on Linux: Part 1 (Prerequisites)

Published on
4,045 Points
845 Views
2 Endorsements
Last Modified:
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.

Note: All screenshots and commands are applied to Ubuntu 16.04


A. Introduction: 

In this first part of this tutorial we will learn what the prerequisites are to install SQL Server vNext on Linux. How we can we check the prerequisites with shell commands and how can we connect to a Linux machine from a Windows PC?


SQL Server vNext can be installed on the follow three Linux flavours available in the market as found in the documentation [Microsoft Documentation]:


  1. Red Hat Enterprise Linux 7.3
  2. Ubuntu Linux 16.04 or 16.10
  3. Install on SUSE Linux Enterprise Server v12 SP2


B. Prerequisites for Installing SQL Server vNext on Linux:

  1. Linux OS (as mentioned above).
  2. Minimum 3.25 GB RAM required.
  3. Minimum 4.0 GB of disk space required.
  4. Network connectivity required to connect with Internet to download the SQL packages.
  5. Port 1433 TCP should be opened on the firewall for SQL Server connections.
  6. Port 22 TCP (which is default) should be open for SSH (SSH client, is a program for logging into a remote machine and for executing commands on a remote machine) connections.


How to check if the SSH Server is running?

Step 1: Open terminal

Step 2: execute command telnet localhost 22


If the output shows OpenSSH and the version then it means that SSH is open and running on your Linux server.


Below is the output after running telnet localhost 22 command:


Figure 1: Checking SSH is working or not


If SSH is not there then we have to install it separately. We can execute the following command to install SSH:


sudo apt-get install openssh-server


Below is the output after executing above command in terminal:


Figure 2: Installation of SSH


In my case it is already installed so giving message openssh-server is already the newest version.


C. How to connect to Ubuntu 16.04 from Windows?


To install SQL Server vNext on Ubuntu 16.04, I need to connect remotely to the Linux server on which Ubuntu is installed. I'll cover two ways to connect remotely to a Linux server from a Windows PC:


  1. Using PuTTY
  2. Using mstsc


C.1 Using PuTTY

To connect with Putty we simply need to download and run the executable file available from the PuTTY website (http://www.putty.org).


Figure 3: Connecting Server with Putty


Enter the IP address of the Linux server and click Open.  Follow the prompts to log into the Linux server.  You will need to use the root or other privileged account that

Figure 4: Entering credentials to connect with Server


C.2 Using mstsc (Microsoft Terminal Services Client)

If we want to remotely connect to the Linux server using mstsc from a Windows server then we need to install Ubuntu Desktop and Xrdp or Xfce (Xrdp is an open source RDP server, which allows us to connect our Linux server with Remote Desktop from a Windows machine). [http://www.xrdp.org/]


Since I am using Ubuntu 16.04 version, I will use xfce Desktop instead, because Ubuntu 12.04LTS Xrdp or Genome desktop is not supported. 


Installing xfce on Ubuntu


Step 1: Open Putty, connect linux server and execute below command to install xfce:

  • sudo apt-get install xubuntu-desktop


Step 2: Execute below command to enable xfce:

  • echo xfce4-session >~/.xsession


Step 3: Edit the config file /etc/xrdp/startwm.sh:

  • sudo vi /etc/xrdp/startwm.sh


Step 4: Add xfce session information

  • Press ESC Key and i to insert the line
  • type xfce4-session before the line /etc/X11/Xsession


Step 5: Exit and Save:

  • Press ESC to finish insert
  • Press :wq key to save and exit


Step 6: Restart xrdp service to apply the changes:

  • sudo service xrdp restart


Step 7: Connect to Linux machine via RDP

  • Open run command in Windows and type mstsc.
  • Enter the IP address of the Linux Server and click "Connect"


Once connected you should see a login as seen below:


Figure 5: Connecting Server with Xrdp/Xcfe


Step 8: Login to the Linux Desktop:


Figure 6: Server connecting is in progress


Below is a sample screenshot of the Ubuntu Desktop:


Figure 7: First desktop on connecting with Ubuntu


D. Performing some pre-checks which are given in section A of prerequisites:


D.1 How to open a terminal from the Linux Desktop

Right click on Ubuntu desktop and click on Open Terminal Here or you can open terminal with Putty also.


Figure 8: Opening Terminal


D.2 Checking whether Ubuntu is 32 bit or 64 bit

Use the "uname" command with the -i switch as shown below


Figure 9: Checking for 32 bit or 64 bit


x86_64 : It means it is 64-bit architecture. For more info click here: https://askubuntu.com/questions/201412/is-x86-64-a-x86-or-x64/questions/201412/is-x86-64-a-x86-or-x64/


D.3 Checking the version of Ubuntu

Use the "lsb_release" command with the -a switch to determine the version installed (as shown below)


Figure 10: Checking version of Ubuntu


As you can see it is showing version 16.04 which is one of the requirements for installing SQL Server vNext.


D.4 Checking RAM in Ubuntu

Use the following command to check the available memory

grep MemTotal /proc/meminfo


Figure 11: Checking Total Memory


The total memory shown is 8166672 KB which is around 7.78 GB and yes I have 8 GB RAM on this Server.


D.5 Check the disk space on the Linux server

Use the df command to determine the space available.

df –h

Figure 12: Checking Total Space on Disk


Showing that it has approximate 131.0 GB space in total.


D.6 Checking internet access in Ubuntu

Use "ping" to check if the server has internet access

ping www.yahoo.com


The best way to check internet access is to use ping command as above. If in output of command it shows some transmitted and received packets then it means internet is working fine. If it shows only transmitted packets and 0 received packets with 100% packet loss then it is the problem with firewall which we have to resolved with the help of network administrator. [ More Info.. ]


Note: Sometimes internet works fine but we are unable to ping external sites via ping command. [ Click Here For More Info ]


E. Conclusion

As you can see it is important to have all the components in place and working before attempting to install SQL Server on vNext.  


I have divided this article into two parts. This part is all about the prerequisites and connecting to the Linux server.  We've also covered some basic commands in Linux to check the prerequisites. You can use references also for basic linux commands which 

I have given on 5th number. In the second part I will describe how to install SQL Server vNext on Ubuntu 16.04 and make a connection with SQL Server and how to execute SQL queries. So stay tuned. 


F. References

1) https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-ubuntu

2) https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/remote-desktop

3) http://www.tutorialspoint.com

4) http://www.sqlservercentral.com/articles/SQL+Next/149118/

5) https://help.ubuntu.com/community/UsingTheTerminal#Commands


2
Comment
0 Comments

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month