Set up Shadowsocks on an Ubuntu VM in Azure for VPN purposes

build a shadowsocks server in Azure

Shadowsocks is one of the techniques that you can use to set up your VPN equivalent server. With Microsoft Azure, you can quickly set up a Ubuntu virtual machine (VM) to host Shadowsocks. But why Ubuntu? Simply because it demands less Azure resource from the cost-saving perspective than other available operating systems. Don’t worry if you barely have the knowledge in Azure or Ubuntu. Follow the steps in the article and you will get there.

Monthly cost of a Shadowsocks server in Azure

Before we start, let’s take a look at the cost of a Shadowsocks server in Azure.

  • VM (Ubuntu): 22.32$/month.
  • Bandwidth: Monthly cost of the first 5GB for free and 0.138$/GB onward for incoming traffic. Outbound traffic from Azure is free.

Let’s say you used 105 GB incoming data in a month which turns out to be 13.8$. Plus the VM cost, you get a total of 36.12$ for that month.
Note: The actual cost may vary over time and the geo region the VM sits in.

To set up Shadowsocks in Azure, you need to:

  1. Set up a Ubuntu server in Azure.
  2. Create a port on the server for Shadowsocks connection.
  3. Set up and configure Shadowsocks.

Now let’s start.

Set up a Ubuntu server in Azure

  1. Open the Azure portal, and log in with your Azure account (Get a one month free trial of Azure with 200$ credit).
  2. Click New, type Ubuntu, and then press Enter.
  3. Select Ubuntu Server 17.04 in the list of matches, and start creating one with the Resource Manager deployment model.
  4. Proceed with the following configuration for the setup:
    • Use the Basic A1 plan at 22.32$/month.
    • Set the Authenticate type to use Password.
    • Create a new resource group to host the server.
    • Set Public IP address to Static.
  5. Once the server is created, note down the Public IP address.

Create a port on the server for Shadowsocks connection

  1. Go to the resource group where the VM is hosted, find and open the <server>_nsg resource.
    This resource functions as the firewall for the server. It comes with a pre-configured inbound security rule to allow management through SSH on TCP port 22.
  2. Add an inbound security rule by providing a name and port, and leave the rest with the default value. Here I set the port to 2000.

Set up and configure Shadowsocks

  1. Use an SSH client to connect to the Ubuntu server using the public IP address, which you noted down earlier, for remote management. PuTTY is the client I use on Windows.
    Upon connection, an SSH client window opens.
  2. Install ShadowSocks by running the following command:
    sudo apt install shadowsocks-libev
  3. Configure Shadowsocks.
    1. Open the config.json file.
      sudo vim /etc/shadowsocks-libev/config.json
    2. Press I to switch to the editing mode.
    3. Update the following settings in the file:
      • Set server to
      • Set server_port to the port you created in the <server>_nsg resource.
      • Set password to the password of your Ubuntu server.
      • Set method to “aes-256-cfb”.
    4. Press ESC, and then type :wq to save the file.
  4. In the Azure portal, restart the Ubuntu server.
    Note: The setup has configured Shadowsocks to automatically start with Ubuntu.
  5. Verify if the ShadowSocks server is listening on the port, in this case 2000.
    netstat -lnp
    If the port was not listened, restart ShadowSocks.
    service shadowsocks-libev restart
  6. Download the Shadowsocks client that is available on Android, iOS, Windows and macOS. For Android and iOS, you may have to get the client from the US app store.
  7. Open the Shadowsocks client, enter the connection information and make the connection. You also have the option of enabling Shadowsocks to handle the traffic only to sites outside of China.

Congratulations! Now you are all set. Enjoy Shadowsocks!

Continue reading “Set up Shadowsocks on an Ubuntu VM in Azure for VPN purposes”

Error message when you connect to an instance of SSAS: “A connection cannot be made to redirector. Ensure that ‘SQL Browser’ service is running”

When you try to connect to an instance of SQL Server 2005 Analysis Services from SQL Server Management Studio, you receive the following error message:
A connection cannot be made to redirector. Ensure that ‘SQL Browser’ service is running. (Microsoft.AnalysisServices)
Additional information:
    No connection could be made because the target machine actively refused it (System)
I checked the SQL Server Browser service and it is running happily at the moment.
I guess the problem may occur after you have additionally installed SQL Server Express after you have installed SQL Server 2005.
I finally resolved this by deleting all the files in the following folder: %ProgramFiles%\Microsoft SQL Server\90\Shared\ASConfig.  And then connect from Management Studio again.

System Configuration Checker fails with “Performance Monitor Counter Check Failed” Message

Another issue I encounter during SQL Server 2005 setup is that System Configuration Checker fails with "Performance Monitor Counter Check Failed" message. By checking the detail of this message, I am prompted to examine the SQL Server 2005 Readme or BOL for the solution to this failure.

However, the solution in the Readme doesn’t work for me. The corresponding settings for the registry key described in the solution is correct on my computer. Additionally I found there is another 004 folder under Perflib which holds the same structure as that of 009. My OS is Windows XP MCE SP2 (Simplified Chinese). The SQL Server I am trying to install is SQL Server 2005 Dev (English).

Mmm…. Then I gave up the 009 folder and embraced 004, synchronised the Last Counter and Last Help of Perflib with the max value of Counter and Help in 004, respectively.

After I made the change, I restarted the installation of SQL Server 2005. The error message from System Configuration Checker is gone.


Conclusion: If the language of OS or SQL Server 2005 you are about to install is not English, you might try folders other 009 in case you encounter this error message from System Configuration Checker during the installation of SQL Server 2005.

You keep receiving the “Pending Reboot Requirement” error message during the System Configuration Check

I encounter an issue when I am trying to make change to the existing installation of SQL Server 2005. I continue to get the error Pending Reboot Requirement during system configuration check and I can’t move on to the next step.
The same thing keeps happening even if I have restarted the computer.
I finally resolved this problem by go to the following registry entry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
Then delete the PendingFileRenameOperations key.

Published Microsoft Knowledge Base (KB) articles

I am very thankful that God leads me to work at Microsoft to be a technical writer. And I do love what I do. Currently I am working primarily on KBs on SQL Server. SQL Server is a very powerful database product of Microsoft. The following are the KBs that are I wrote and are available on the web now. Glory to God, Hallelujah!

The fear of the Lord is the beginning of knowledge. (Proverbs 1:7)

SQL Server Data Engine

SQL Server Analysis Services

SQL Server Express

SQL Server Mobile

SQL Server Notification Services

SQL Server Reporting Services

SQL Server Tools

Visual Studio 2005

World on Fire

I recalled a song Lisa once shared with me, “World on Fire”, by Sarah McLachlan. There is also a video clip which themes this song. It tangibly demonstrated in figure how much we can do that may help those living in severe poverty around the globe. With little you do, you may change those lives. The lyrics strikes me as well.

World on Fire
Hearts are worn in these dark ages
You’re not alone in this story’s pages
Night has fallen amongst the living and the dying
And I try to hold it in, yeah I try to hold it in
The world’s on fire and
It’s more than I can handle
I’ll tap into the water
(I try to pull my ship)
I try to bring more
More than I can handle
(Bring it to the table)
Bring what I am able
I watch the heavens and I find a calling
Something I can do to change this moment
Stay close to me while the sky is falling
Don’t wanna be left alone, don’t wanna be alone
Hearts break, hearts mend
Love still hurts
Visions clash, planes crash
Still there’s talk of
Saving souls, still the cold
Is closing in on us
We part the veil on our killer sun
Stray from the straight line on this short run
The more we take, the less we become
A fortune of one that means less for some
[Chorus X2]