How to Create Virtual Machine and Install OpenVPN on Microsoft Azure
Azure is a powerful cloud computing platform created by Microsoft. It provides various services and solutions including Web apps, virtual machines, SQL database and so forth. I’m interested in virtual machine service and have been experiencing it for a few days. During my work time, I often need to switch platforms among Windows, Mac OS X, and Linux. VMWare Workstation is an excellent software for running different operating systems, but it costs CPU, Memory and disk storage.
How to Create Virtual Machines on Microsoft Azure
Visit https://azure.microsoft.com. You can try Azure for free and get $250 credits.
Click Portal to login to the dashboard. At the bottom, click NEW > COMPUTE > VIRTUAL MACHINE to create a VM.
You can select FROM GALLERY to choose more images.
When creating a virtual machine, you can specify CPU and memory. It’s amazing.
We can also set the region of the virtual network.
Note: if select QUICK CREATE and choose Linux, the username is azureuser by default.
How to login to Windows VM or Linux VM on Azure?
If you create a Windows virtual machine, click CONNECT and download a .rdp file.
Double-click the RDP file to run Remote Desktop Connection.
If you create a Linux virtual machine, launch putty and specify the host name. And then click open to login.
How to Setting Up OpenVPN on Linux Virtual Machines
A virtual private network (VPN) is useful for remote work. How can we set up a VPN on the virtual machine that located on Microsoft Azure? I followed the article - OpenVPN on Windows Azure – to build my own VPN server.
Here are the steps:
- Create virtual machine endpoints on Azure.
- HTTPS: TCP 443
- AdminUI: TCP 943
- OpenVPN Server: UDP 1194
Install OpenVPN on Linux and set OpenVPN password. Download:
wget -c http://swupdate.openvpn.org/as/openvpn-as-2.0-Ubuntu13.amd _64.deb
sudo dpkg -i openvpn-as-2.0-Ubuntu13.amd _64.deb
sudo passwd openvpn
- Login OpenVPN administration page, change server name and user permissions.
The hostname is which I used to login Linux.
The username is which I used to login Linux.
- After finishing the configuration, login OpenVPN user page. You have two options for VPN connection: either download OpenVPN Connect or download connection settings (.ovpn file).
- Run OpenVPN Connect or OpenVPN client.
- OpenVPN Connect has configured everything for VPN connection. You just need to directly run the exe file.
- Alternatively, if you want to use OpenVPN client, copy the .ovpn file to **
\config** and then run OpenVPN GUI.
- Finally, we can see the connection status.