Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Lab Manual – SQL Server 2017 on Linux VM

__________________________________________________________________________________

Lab 1: SQL Server 2017 on Linux VM


In this Lab we will learn how to create a Linux VM with SQL Server 2017 image. Once the VM is
created we will connect to the SQL Server using SSMS. The steps we will be implementing:

Step 1: Create the Virtual Machine with the SQL Server 2017 on Ubuntu image

Step 2: Configure the sa password

Step 3: Connect to the SQL Server on the Virtual Machine using SSMS

Step 1: Create the Virtual Machine with the SQL Server 2017 on Ubuntu image

1. Open the Azure Portal and navigate to the Resource Group you have created. [If you do not have
a Resource Group, create a new one with the name as sql-labs-rg in the Southeast Asia location.]
2. Click on Add button to add a new resource to the Resource Group. Type “SQL Server 2017” in
the search box and select the “Free SQL Server License: SQL Server 2017 Express on Ubuntu
Server 16.04 LTS” image and click on Create.
3. Enter the following parameter values leaving the other values at default in the VM pane that has
opened. Click Review+Create and once the validation is complete click on Create button.

Subscription [Your subscription name]


Resource Group sql-labs-rg
Virtual Machine Name sql-linux-vm
Region Southeast Asia
Size D2s_v3
Authentication Type Password
User Name Labuser
Password/Confirm Password Password@123
Inbound Rules Allow Selected Ports
Select the SSH(22) port from the list
OS Disk Type Standard HDD
Virtual Network Sql-linux-vnet
Subset 10.0.0.0/16
Public IP sql-linux-vm-ip
Boot Diagnostics Off
Lab Manual – SQL Server 2017 on Linux VM
__________________________________________________________________________________

Step 2: Configure the sa password

1. Select the newly created Virtual Machine and copy the Public IP from the Overview page.

2. Start Putty and enter the IP address copied in the Host Name field and click on Open.
3. Enter the below credentials you used when creating the Virtual Machine.
login as: labuser
password: Password@123
Lab Manual – SQL Server 2017 on Linux VM
__________________________________________________________________________________
4. At the Linux command prompt we will first change the SQL Server “sa” password. Enter the
following command and enter a password and confirm the password for sa user:
$sudo /opt/mssql/bin/mssql-conf set-sa-password

5. Enter the following command to start SQL Server

sudo systemctl start mssql-server

6. Check the services are running

sudo systemctl status mssql-server

Step 3: Connect to the SQL Server on the Virtual Machine using SSMS

1. Start SQL Server Management Studio on your system and enter the Public IP of the SQL Server
VM. Enter the user name as “sa” and password as what you specified in the previous step. Click
on Connect to connect to the SQL Server instance running on the Azure Linux VM.
2. Try creating a database and tables in the connected server.

You might also like