This is a step by step procedure on how to create a Linux virtual machine (VM) using custom templates, associating and dissociating IP addresses to shut down the machine.
This will guide on how to create a Linux VM within the shortest possible time, also how to save cost by dissociating the VM's IP address when it's no longer in use and association the VM's IP when needed.
We will also learn how to create new IP addresses and associating it to an existing VM. Also how to connect a VM using windows power shell with ssh.
Below are the steps to follow:
Step 1. Creating a VM using custom templates.
Step 2. Associating and dissociating a VM's IP address.
Step 3. Creating new IP address for a VM.
Step 4. Connect and configure the VM with ssh on windows PowerShell.
1. Creating a VM using custom templates
- Log on to azure
- search for deploy a custom template on the task bar
- Select Create a Linux virtual machine
- On the Basics tab. You will be required to just create the resource group, username and password.
- Create new resource group. Give it a unique name and click OK
- In the instance details
- Set the Admin username and Admin password or Key
- Review and Create
- Create
- Wait for the resource to create, the Go to resource
2. Associating and dissociating a VM's IP address
- Select the simpleLinuxVM
- In the Overview, under the Properties tab, click on the Public IP address in the Networking section.
- Drag out the Idle timeout to the maximum 30 minutes. This will ensure the VM does not time out after the default 4 minutes
- Click on Stop, to stop the VM from running
- Click on OK
- Stopping a VM does not stop all the cost associated to the VM. The VM's IP address is a cost on its own and can be stopped when not needed.
- Search for Public IP address on the task bar.
- Select the simpleLinuxIPaddress
- Select Dissociate and click on Yes
- Notice Dissociate is greyed out
- Select Associate to re-associate the VM with an IP address. Pick Network Interface in the resource type drop-down menu. Pick SimpleLinuxVMNetInt in the Network interface drop-down menu. Click OK
- Notice Associate is greyed out.
- Go to properties of the simplelinuxVM, notice the Public IP address is now masked i.e no longer showing
3. Creating new IP address for a VM.
- On the home page, search for ** Public IP address** and ** create a resource**
- Give it a name, Review and create
- Create
- To dissociate the old IP address from the VM.
- Go to home and search for Public IP address
- Select Dissociate, click OK
- Go back to Public IP address and select the new IP address
- To associate the new IP address to the new VM. Select associate, on the menu select network interface and the VMname. OK
- In the settings/configuration tab of the new IP address, drag out the idle time to maximum. To ensure the IP address does not time out too often
4 - Connect and configure the VM with ssh on windows PowerShell.
- Search for an open Microsoft PowerShell on your computer
- Enter command prompt ssh username@IPaddress, and enter
- Confirm you want to connect by entering Yes and enter
- tEnter Password previously set. Notice you won't see the password typing out. This is a security feature for Linux. Press enter
- To do anything into the VM, you need to enter root. Enter the command sudo suand enter.
- From this point you can go ahead to install anything in the VM
Please drop questions and comments in the comments section.
Top comments (0)