---
title: Installing Windocks in Azure
description: Quick guide for installing Windocks in Azure and evaluating use with both AADDS and Azure File Shares.
---

 

 

 TECHNICAL DOCS

# Installing Windocks in Azure

### Quick start guide for running an evaluation of Windocks in Azure

#### [Prerequisites](https://23302346.hs-sites.com/docs-install-azure#prereq)

#### [Preparing your VM for Windocks](https://23302346.hs-sites.com/docs-install-azure#prepare)

#### [Installing and Configuring Windocks](https://23302346.hs-sites.com/docs-install-azure#config)

#### [Your first database container](https://23302346.hs-sites.com/docs-install-azure#first)

#### [Deploying multiple containers](https://23302346.hs-sites.com/docs-install-azure#multiple)

 

 

## **Prerequisites**

Evaluating Windocks works fastest when you have:

- Azure Active Directory Domain Services (AADS) [installed and configured](https://learn.microsoft.com/en-us/azure/active-directory-domain-services/tutorial-create-instance)
- An Azure Windows VM targeted for Windocks installation.  The Azure MarketPlace features a prebuilt image with [SQL Server 2022](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/microsoftsqlserver.sql2022-ws2022?tab=Overview) installed.
- The Azure VM [joined to the AADDS domain](https://learn.microsoft.com/en-us/azure/active-directory-domain-services/join-windows-vm)
- *Optional*:  If you want to utilize Azure file shares with Windocks to either access backup files or to store VHDX files, you should also have a [storage account](https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-portal?tabs=azure-portal#create-a-storage-account) with an [Azure file share](https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-portal?tabs=azure-portal#create-an-azure-file-share). 
  
  You should also refer to the [specific Windocks pre-installation instructions to work with Azure file shares](https://23302346.hs-sites.com/docs-azure-file-shares).

[Back to Top ](https://23302346.hs-sites.com/docs-install-azure#top) [Back to Technical Docs Gallery ](https://23302346.hs-sites.com/resources)

 

 

## Preparing your VM for Windocks

Once your [SQL Server 2022](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/microsoftsqlserver.sql2022-ws2022?tab=Overview) VM is deployed and after you have joined it to your [AADDS domain](https://learn.microsoft.com/en-us/azure/active-directory-domain-services/join-windows-vm),  you can follow the steps below to prepare your virtual machine and SQL Server for Windocks installation.

1. Login to your VM as the administrator.
2. Download your Windocks installer to your Downloads folder
3. Use Notepad to create prepare a key.txt file with just a single line containing your license key.
   
   Your Downloads folder might look like this.
   
   ![azure-vm-prep-downloads](https://23302346.hs-sites.com/hs-fs/hubfs/azure-vm-prep-downloads.png?width=1125&height=593&name=azure-vm-prep-downloads.png)
4. Use SQL Server Management Studio (SSMS), already installed on the VM image, to connect to your default SQL Server database instance.  You should be able to connect using Windows Authentication to this default instance.
5. In SSMS, expand the database, right-click on **Security** and click **New Login...**
   
   ![sssms-new-login-for-install](https://23302346.hs-sites.com/hs-fs/hubfs/sssms-new-login-for-install.png?width=1174&height=731&name=sssms-new-login-for-install.png)
6. In the **Login - New** window, enter **BUILTIN\Administrators** and click **OK**.
   
   ![ssms-builtin-administrators](https://23302346.hs-sites.com/hs-fs/hubfs/ssms-builtin-administrators.png?width=698&height=660&name=ssms-builtin-administrators.png)
7. Expand the **Logins **folder to expose the different logins, right-click **BUILTIN\Administrators**, and choose **Properties**.
8. In the **Login Properties** window, choose **Server Roles** from the left pane, check **sysadmin** and click OK.
   
   ![ssms-server-roles](https://23302346.hs-sites.com/hs-fs/hubfs/ssms-server-roles.png?width=698&height=660&name=ssms-server-roles.png)
9. * Optional.*  If you have any default users you would like to add to containers, follow these steps to add [AADDS users using SSMS.](https://23302346.hs-sites.com/docs-aadds#ssms)
   
   You are now done with SSMS and may disconnect from the default database instance.  You will not be using this default instance any further as your subsequent Windocks installation will disable it.

You are now ready to run the Windocks installer.

[Back to Top ](https://23302346.hs-sites.com/docs-install-azure#top) [Back to Technical Docs Gallery ](https://23302346.hs-sites.com/resources)

 

 

## Installing and Configuring Windocks

To run well on the default VM provided in the Azure Marketplace, you should follow these instructions for installation and post-installation prior to using Windocks for the first time.

1. From your File Explorer downloads window, double-click your Windocks install executable.  Expect this install process to take some time, as it is installing Windows server roles to enable both the web UI and database virtualization functions.  Please note that the installation process will require a server reboot to complete.
2. After the computer has rebooted, move your key.txt you created in step 3 to your **C:\Windocks** directory.  You may need to overwrite an empty **C:\Windocks\key.txt** file already in the directory.
3. Use notepad to open up **C:\Windocks\config\node.conf**.  Navigate down to the section titled "**Disk locations for containers and VHDXes**".  Remove the # characters to uncomment the **CONTAINER_BASE_DIR** and **VHD_PARENT_DIRECTORY** lines and replace the paths with paths to the desired locations.  Save the changes to the **node.conf** file.**
   
   ![notepad-node-conf-install](https://23302346.hs-sites.com/hs-fs/hubfs/notepad-node-conf-install.png?width=1261&height=709&name=notepad-node-conf-install.png)
   
   **The **CONTAINER_BASE_DIR** parameter must point to a locally attached disk or on a low-latency native Window file share (NOT an Azure file share) specified by fully qualified UNC name.  It is recommended that you change the **CONTAINER_BASE_DIR** to a drive other than the system disk, as each container can consume about 1GB for SQL Server 2022.  In the sample screenshot, a new directory was created on the local F: using File Explorer prior changing the **CONTAINER_BASE_DIR** value, as Windocks does not create the specified directory.
   
   The **VHD_PARENT_DIRECTORY** parameter should also be changed from the default system disk. You can use either a locally attached disk, a low latency native Windows file share, or an Azure file share.  If you utilize a Windows file share or an Azure file share, you should use fully qualified UNC names.  The sample screenshot assumes that the [**Azure file share was prepared for use by Windocks prior to installation**](https://23302346.hs-sites.com/docs-azure-file-shares).
4. To apply the new **key.txt** file and the changes to your **node.conf** file, open **services.msc** and restart the **Windocks** service.
   
   ![restart-windocks-service](https://23302346.hs-sites.com/hs-fs/hubfs/restart-windocks-service.png?width=1228&height=769&name=restart-windocks-service.png)

Please note that these global configuration settings for **CONTAINER_BASE_DIR** and **VHD_PARENT_DIRECTORY**  should be changed before you use Windocks for the first time.  If you want to change these settings after you have used Windocks, you must delete all images and containers in your existing Windocks installation before changing these settings again. 

You are now ready to use Windocks!

[Back to Top ](https://23302346.hs-sites.com/docs-install-azure#top) [Back to Technical Docs Gallery ](https://23302346.hs-sites.com/resources)

 

 

## Your first database container

Much of the power of the orchestration provided by Windocks is specified through a [dockerfile.](https://23302346.hs-sites.com/doc-dockerfile)  The dockerfile can specify source databases, scripts to run, and more.

Windocks ships with a number of sample dockerfiles in its **C:\Windocks\samples** directory.  A very simple example is located in the directory **C:\Windocks\samples\cloneFromFullBackup**.

### Modifying the sample dockerfile for your Azure VM

Because the default VM utilizes SQL Server 2022, you should plan to modify the sample dockerfile to use SQL Server 2022 instead of the SQL Server 2019, as specified in the sample as shipped.  You can also optionally modify the dockerfile to retrieve backups from [an Azure file share that has been set up to work with Windocks](https://23302346.hs-sites.com/docs-azure-file-shares).

1. *Optional*: Copy the backup file **C:\Windocks\dbbackups\customerdatafull.bak** to your Azure file share to demonstrate how Windocks can read backups from [Azure file shares when set up properly](https://23302346.hs-sites.com/docs-azure-file-shares).
2. From **notepad**, open **C:\Windocks\samples\cloneFromFullBackup\dockerfile
   
   ![notepad-clone-from-full-backup](https://23302346.hs-sites.com/hs-fs/hubfs/notepad-clone-from-full-backup.png?width=1218&height=711&name=notepad-clone-from-full-backup.png)
   
   **
3. Change the first line of the dockerfile from "**FROM mssql-2019**" to "**FROM msqlsvc-2022**" and save the file.  This step is required as the default SQL Server image from the VM image is SQL Server 2022, not SQL Server 2019.
4. *Optional:* Edit the path specified in the **SETUPCLONING** command to a fully qualified UNC path for the backup file in your Azure file share.  Save the dockerfile.
   
   ![notepad-clone-from-full-backup-modified-2](https://23302346.hs-sites.com/hs-fs/hubfs/notepad-clone-from-full-backup-modified-2.png?width=1218&height=711&name=notepad-clone-from-full-backup-modified-2.png)
   
   You can now use this dockerfile to build a Windocks image and to create your first container.

### Building your first image and container

The following instructions utilize the docker command line, which is only available via RDP to the Windocks server.  There is also a [web user interface](https://23302346.hs-sites.com/doc-webapp) and a [REST API.](https://23302346.hs-sites.com/rest-api)

To build your first container:

1. Open a **cmd** window
2. Type **cd C:\Windocks\samples\cloneFromFullBackup**
3. Type **docker build -t test1 .**
   
   (Note the period as the last argument  to denote the current directory.)  Your output will be similar to the following.
   
   ![docker-build-output-3](https://23302346.hs-sites.com/hs-fs/hubfs/docker-build-output-3.png?width=979&height=512&name=docker-build-output-3.png)
4. Type **docker create test1  
   **  
   Your output will be similar to the following:
   
   **![docker-create-output](https://23302346.hs-sites.com/hs-fs/hubfs/docker-create-output.png?width=979&height=512&name=docker-create-output.png)
   
   **Note the first few characters of the **ContainerID**.  In the screenshot example, the first few character were **ada4**.
   
   Note the **ContainerPort **output.  In the screenshot, it was **ContainerPort = 10002**.
5. Type **docker start **followed by the first few characters of the ContainerID.  Windocks will return the ContainerID characters.
   
   ![docker-start](https://23302346.hs-sites.com/hs-fs/hubfs/docker-start.png?width=979&height=512&name=docker-start.png)
6. From SSMS, login using your *hostname*,*ContainerPort*.  (Note the comma between the hostname and ContainerPort).  From your administrator account, you should be able to login with the default Windows authentication.
   
   ![hostname-containerport](https://23302346.hs-sites.com/hs-fs/hubfs/hostname-containerport.png?width=477&height=315&name=hostname-containerport.png)
   
   After the database is connected, you should be able to browse the database.
   
   ![ssms-browse-clonefromfullbackup](https://23302346.hs-sites.com/hs-fs/hubfs/ssms-browse-clonefromfullbackup.png?width=1232&height=731&name=ssms-browse-clonefromfullbackup.png)

Congratulations, you've created your first database container using Windocks on Azure.

[Back to Top ](https://23302346.hs-sites.com/docs-install-azure#top) [Back to Technical Docs Gallery ](https://23302346.hs-sites.com/resources)

 

 

## Deploying multiple containers

Repeat the same process outlined above with your own test data.  To see your list of running docker containers, use the **docker ps** command.

![docker-ps](https://23302346.hs-sites.com/hs-fs/hubfs/docker-ps.png?width=1110&height=512&name=docker-ps.png)

Windocks provides the unique capability in Azure to run multiple, isolated database containers efficiently on same Azure VM - all accessible by hostname or IP address and port number.

If you changed your default container directory, you can see the container files in the directory specified in **node.conf**.  You'll notice each of these containers only requires 1GB overhead on SQL Server 2022, independent of the size of the underlying databases.

![container-file-size](https://23302346.hs-sites.com/hs-fs/hubfs/container-file-size.png?width=1125&height=593&name=container-file-size.png)

The actual data for these databases reside in virtual hard disks used for database images and clones.   In this example, an Azure file share was used to store the virtual hard disks.

When multiple writable database containers are deployed on the same base image (noted by the "friendly" names in the directory), Windocks utilizes zero copy cloning to save disk space, only utilizing additional space (noted by the "non-friendly" names in the directory) for the differences written.

The following screenshot shows the VHDX files residing in the directory specified by **node.conf**.

![vhdx-files](https://23302346.hs-sites.com/hs-fs/hubfs/vhdx-files.png?width=1125&height=593&name=vhdx-files.png)

With Windocks in Azure, you can reduce your infrastructure on management costs significantly, both by consolidating multiple SQL Server environments onto a single VM and utilizing zero copy cloning to save on storage.

 

 

[Back to Top ](https://23302346.hs-sites.com/docs-install-azure#top) [Back to Technical Docs Gallery ](https://23302346.hs-sites.com/resources)

## Extend CI/CD to your data layer

[GET A DEMO ](https://23302346.hs-sites.com/schedule-demo) [TRY FREE ](https://23302346.hs-sites.com/try-free)