How To Set Up an SQL Express Database for Horizon View
It's not hard, but the steps need to be followed carefully.
I've installed Horizon View, VMware's Virtual Desktop Infrastructure (VDI) product, dozens of times over the past decade. With each release, for the most part, the installation process gets easier and easier. One aspect I always have trouble with, however, is installing the database Horizon uses for View Composer and logging events.
Even though installing and configuring the database isn't that difficult, and is also documented by VMware, I always find myself missing a step or two, and it seems to take more time than it should. To help other users who find themselves in the same boat, here are my step-by-step instructions on how to install an SQL Express Database for Horizon View.
Before installing SQL Express, I checked the VMware Product Interoperability Matrices.
Once I verified that SQL Server 2012 Express (SP2) was compatible with the version of Horizon I was installing (Horizon 7.2), I downloaded it (SQLEXPRWT_x64_ENU.exe) along with SQL Management Studio (SQLManagementStudio_x64_ENU.exe) from Microsoft, available here. Note that the Express version of the database should only be used for non-production deployments of Horizon.
Once the SQL database was downloaded, I installed NetFx3, which is required for the SQL Server. If it's not already installed, you'll get an error message.
I installed NetFx3 on Windows Server 2012 via the Server Manager Tool, by clicking Add Roles and Features under the Manage tab (Figure 1), then selecting .NET Framework 3.5 Features (Figure 2). The required source files for the .Net Framework 3.5 were on the Windows Server 2012 (R2) DVD that was mounted in my DVD drive. I specified the source files as D:\Sources\SxS.
I installed a new SQL stand-alone instance from the SQL ISO using Mixed Mode for authentication (Figure 3) and accepted all the defaults, including the database name "SQLExpress."
After I finished installing SQL Server, I installed the SQL Manager from the file downloaded earlier. To do this, I selected "Perform a new installation of SQL Server 2012" and accepted all defaults during the installation. I then rebooted my server.
Configuring the View Events Database
The View Events Database is used to store a database log about a Horizon system. Although not required, this information is extremely helpful. To configure the Events Database, I created a database using SQL. I first entered SSMS in the run dialog on the Windows Server to bring up SQL Server Management Studio. I then logged into the SQL Server Management Studio, connected to the default database, right-clicked Databases, and then clicked New Database. Finally, I named the database "ViewEvents" (Figure 4
Since the SQL Server was on a server other than my View Connection server, I had to enable networking for the database. To do this, I went to the SQL Server Configuration Manager, expanded the SQL Server Network Configuration, selected Protocols for SQLEXPRESS, right-clicked TCP/IP and selected Enable (Figure 5).
I had to re-start SQL Server for the changes to take effect. After the SQL Server had finished restarting, I went back to the SQL Server Configuration Manager, double-clicked TCP/IP and got the TCP dynamic port it was using (Figure 6).
Configuring VMware Horizon View Event Database
Once I'd configured the SQL database, I configured Horizon to use the database to store View Events. To do this, I logged into my View Administrator, then clicked on the Events Configuration tab and entered the database server, port and user (Figure 7
). My View Events were then successfully stored in an SQL Express database.
Configuring the View Composer Database
View Composer is a feature used to create linked clones; it requires a database. I configured View Composer to use my SQL Server Express database by taking the following steps.
While installing View Composer, I clicked on ODBC DNS setup. This brought up a dialog to set up the ODBC connection. After selecting the System DNS tab, I entered "ViewComposerDB" for the name of the ODBC DNS Setup text box, described it as the View Composer Database, then selected the local\SQLEXPRESS database (Figure 8) because View Composer and the SQL database were installed on the same server.
I was then presented with a dialog for the database information (Figure 9
). I entered "sa" for the username of the ODBC Data Source Administrator, entered my password, and clicked Next. That was all that was required to set up View Composer to use my database.
It's not terribly difficult to connect your Horizon deployment to a database. Following the instructions here, you shouldn't find it difficult to set up and use SQL Server Express with Horizon either. Proceed carefully, though; if you miss any of these steps, you won't be able use the database to store your events and use it with View Composer.
Tom Fenton works in VMware's Education department as a Senior Course Developer. He has a wealth of hands-on IT experience gained over the past 20 years in a variety of technologies, with the past 10 years focused on virtualization and storage. Before re-joining VMware, Tom was a Senior Validation Engineer with The Taneja Group, were he headed their Validation Service Lab and was instrumental in starting up its vSphere Virtual Volumes practice. He's on Twitter @vDoppler.