In this article we will setup the lab environment using Oracle Virtual Box and install Ubuntu operating system followed by installation of SQL Server 2022 on Ubuntu.
Step-1: Install Oracle Virtual Box
Kindly download Oracle Virtual Box package as per your operating system from https://www.virtualbox.org/wiki/Downloads and install it. Kindly also install Virtual Box guest additions using http://download.virtualbox.org/virtualbox/7.0.6/VBoxGuestAdditions_7.0.6.iso
Step-2: Create a Virtual Machine
- Launch Oracle VM VirtualBox Manager
- Click on New
Fill the “Name”, “Folder”, “Type” and “Version” fields in “Virtual machine Name and Operating System” window of “Create Virtual Machine” wizard and click next.
Select appropriate values for memory and processors in “Hardware” window and click next.
Create a virtual hard disk and click next
On summary page click Finish
Download the iso image of Ubuntu from https://ubuntu.com/download/desktop and mount it to newly created virtual machine “UbuntuMachine” and start the machine.
Upon start, you will be prompted to install Ubuntu. Install it by following the wizard. Once installed, stop the VM and remove iso.
Step-3 Install SQL Server on Ubuntu
Start the VM and open terminal
In the terminal follow the instructions given in MS article https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-2017
Please note that even after adding the /opt/mssql-tools/bin/ to PATH environment variable in ~/.bash_profile as per below command, it was not getting added into PATH variable.
echo ‘export PATH=”$PATH:/opt/mssql-tools/bin”‘ >> ~/.bash_profile
As per above screenshot, I had to run below command to add /opt/mssql-tools/bin/ to PATH environment variable in ~/.bash_profile
export PATH=”$PATH:/opt/mssql-tools/bin” >> ~/.bash_profile
After this, I was able to connect to SQL instance successfully.
Hope this article will help you to set up a lab environment for SQL Server on Linux.
Happy Learning !!