Creating Linux Tools VM
Overview
We will deploy a Linux (CentOS) VM to use it as our workstation.
Deploying Linux Tools VM
-
In Prism Central > select Menu > Compute and Storage > VMs, and click Create VM
-
Fill out the following fields:
- Name - Initials-Linux-ToolsVM
- Description - (Optional) Description for your VM.
- Number of VMs - 1
- CPU(s) - 4
- Number of Cores per CPU - 1
- Memory - 4 GiB
- Click Next
- Under Disks select Attach Disk
- Type - DISK
- Operation - Clone from Image
- Image - Linux_ToolsVM.qcow2
- Capacity - leave at default size
- Bus Type - leave at default SCSI Setting
- Click Save
- Under Networks select Attach to Subnet
- VLAN Name - Primary
- Network Connection State - Connected
- Assignment Type - Assign with DHCP
- Click Save
- Click Next at the bottom
-
In Management section
- Categories - leave blank
- Timezone - leave at default UTC
-
Guest Customization -
- Script Type - Cloud-init (Linux)
- Configuration Method - Custom Script
Do you need to create a SSH key pair?
You can use any online ssh key generator if you are using Windows. Execute the following commands in you are in a Linux / Mac environment to generate a private key.
- Paste the following script in the script window
#cloud-config # Set the hostname hostname: myhost # Create a new user users: - default - name: nutanix groups: wheel, users ssh_authorized_keys: # Paste the generated public key here - ssh-rsa AAAAB3NzaC1.... # You can also use the salter 1N or 6N format using OPENSSL (openssl passwd -1 -salt SaltSalt "yourplaintextpassword") # Paste the generated password here passwd: $1$SaltSalt$aOsqVFP2QULyFo5JYkOYB/ shell: /bin/bash lock-passwd: false ssh_pwauth: True # Enable password authentication for root ssh_pwauth: True # Run additional commands runcmd: - 'sleep 10' # sleeping for the network to be UP - 'echo "nutanix ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' # Run package upgrade package_upgrade: true # Install the following packages - add extra that you would need packages: - git - bind-utils - nmap - curl - wget - vim - python3 - python3-pip
-
Click on Next
- Click Create VM at the bottom
- Go back to Prism Central > Menu > Compute and Storage > VMs
- Select your Initials-Linux-ToolsVM
-
Under Actions drop-down menu, choose Power On
Note
It may take up to 10 minutes for the VM to be ready.
You can watch the console of the VM from Prism Central to make sure all the clouinit script has finished running.
-
Login to the VM via SSH or Console session, using the following command: