This guide will teach you how to install Kali Linux on Azure Cloud Virtual Machine and securely access Kali Linux from anywhere with Azure Cloud VM.
Cloud computing can help us to access web applications, web services or a complete operating system anywhere on any device. Most popular technology companies like Microsoft, Google, Amazon etc., provide Cloud services to their customers. Cloud computing has made things easier and faster, and can save resources and time.
Azure Cloud Virtual Machine Setup
We can use Microsoft Azure cloud services to set up Kali Linux and access it from different operating systems and devices. Click on the creative resource option under the Azure Services section. Search for the cloud service you need and click the create option under the service.
Now configure the virtual machine before you can use it. Choose the Free Trial as a subscription plan, then create a resource group. Enter the instance details like VM’s name, region, and operating system you want to deploy in this virtual machine.
Now set the size of your virtual machine, i.e. its virtual CPUs and RAM. By default, a free services package consisting of 1 GB of RAM and a single CPU would be selected, available freely for the first 750 hours. But selecting a package consisting of 8 GB RAM and 2 virtual CPUs is recommended so that Kali Linux work seamlessly. Then select the authentication mode (SSH public key or password).
Scroll down and select the Allow selected ports option so that you can connect this machine to any device through SSH. Click on the Next: Disks button to configure disk storage and network information or click the Review + create button and it’ll automatically configure it to the default settings.
Once you’ve reviewed all settings of the virtual machine click on the Create button to start the deployment of the Kali Linux to the Cloud.
Now to manage the Kali Linux azure cloud virtual machine, click the Go to resource button when you see the success message pop up window. You can start, stop, restart or delete the virtual machine from this dashboard.
Connect Kali Linux VM from Windows
Now you can connect or control the Kali Linux VM from a windows machine through SSH or RDP. Click the Connect tab from the panel to the left of the screen. We’ve enabled the SSH option so we’ll take the username and IP address from the SSH section.
Now open the windows PowerShell terminal and run the following command and enter the password for the user you set out while configuring the Virtual Machine.
“[email protected]” is the username and IP we’ve got from the virtual machine. Replace it with the one you get from the virtual machine. You’ll get access to the Kali Linux running on the Azure cloud. Use any Kali Linux command to check the working of the VM machine, for example, check the Kali Linux version installed on the Virtual machine using the following command:
To use it in desktop mode you need to install a desktop environment for Linux. You can use any desktop environment of your choice but here we are going to use the XFCE DE because it is lightweight and work smoothly. Before that, Upgrade the system using the following command:
sudo apt update && upgrade
Now run the following command to install the DE and XRDP server on your virtual machine.
sudo apt install kali-desktop-xfce xrdp
Xrdp server allows us to connect Linux VM to the desktop mode. After the installation of these packages, we can be able to open the Kali Linux Virtual Machine in desktop mode. But Before that, configure the RDP connection on your Cloud VM.
RDP Network Rule Setup on Azure Cloud Virtual Machine
Add the RDP port to the Network security rule on the Virtual machine. Click on the Networking tab and press the “Add inbound port rule” button to add a new rule for the RDP port.
A new window will open up, add the RDP port number in the textbox for “Destination port ranges“, select TCP as a protocol and choose to Allow for action, and set the name for this RDP port. Press the Add button and a new rule will be added to the Inbound port rules list.
Now to connect your virtual machine start the XRDP server using the following command:
sudo service xrdp start
Now you’ll get the connection file for the RDP in the Azure cloud VM by clicking which you can directly connect to it. Click the Download RDP File button under the RDP section and click the downloaded file to open the remote desktop connection. Enter the username and password to use your Kali Linux in desktop mode.
Access Kali Linux from Mobile Devices
You can experiment with your Kali Linux on your IOS and Android smartphones as well. Download the Microsoft remote desktop application on your mobile device available on the App store and Play store. Open the application, and click the plus icon to add a new PC. Add details of your Cloud virtual machine i.e. IP of the machine and port number of the RDP.
You can also give friendly names to your machines so that recognizing machines would be easy for you when you have saved multiple machines. After that connect it to Kali Linux virtual machine and enter your username and password which you’ve set while configuring the virtual machine.
Remember that this Azure cloud service is paid once you’ve used your free credit. When you aren’t using this Virtual Machine, shut down it to prevent yourself from service charges.