- Support OS: Ubuntu 24.04
- Architecture: amd64, aarch64
Please enter the root environment first:
sudo su
To install these packages, run the following command:
apt install vim openntpd -y
Using the shell
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ParrotXray/CloudStack-4.20.0-Installation-Guide/refs/heads/main/cloudstack_install.sh)"
- Install SSH by running the following command:
apt install openssh-server -y
- Configure the SSH configuration file by editing it with the following command:
vim /etc/ssh/sshd_config
- Append the following lines to the end of the file:
PermitRootLogin yes
KexAlgorithms=+diffie-hellman-group-exchange-sha1
PubkeyAcceptedKeyTypes=+ssh-dss
HostKeyAlgorithms=+ssh-dss
KexAlgorithms=+diffie-hellman-group1-sha1
- Save the file and exit.
- Restart the SSH service to apply the new configuration:
systemctl restart ssh
Before configuring the network, you need to install some required packages.
Run the following command to install net-tools and bridge-utils:
apt install net-tools bridge-utils -y
This will install the necessary tools for managing network interfaces and bridges on your Ubuntu.
To configure the network, follow these steps:
- Use the following command to get details about your network cards:
ifconfig
Make a note of the name of the network card that you want to use for the network bridge.
- Edit the network configuration file by running the following command:
vim /etc/netplan/01-network-manager-all.yaml
- Modify the file as follows:
network:
version: 2
renderer: networkd
ethernets:
$NATNIC:
dhcp4: false
dhcp6: false
optional: true
bridges:
cloudbr0:
dhcp4: false
dhcp6: false
interfaces: [$NATNIC]
addresses: [$LANIP/$CIDR]
routes:
- to: default
via: $GATEWAY
nameservers:
addresses: [$DNS1, $DNS2]
parameters:
stp: false
forward-delay: 0In the configuration file provided above, you need to replace the following parameters with your own settings:
- $NATNIC: the name of your network card
- $LANIP: This should be replaced with the IP address you want to set. For example,
192.168.4.100. - $CIDR: This should be replaced with the subnet mask of your network card, expressed in CIDR notation. To calculate the CIDR notation from the subnet mask, you can use an online subnet calculator or consult the documentation for your network equipment. For example, if your subnet mask is
255.255.248.0, the CIDR notation is/21. - $GATEWAY: This should be replaced with the IP address of your network gateway. For example,
192.168.0.1 - $DNS: Enter the DNS server IP address. For example,
8.8.8.8,8.8.4.4
Notice: Misconfiguration may cause the remote end to fail to connect
- Save the file and exit.
- Set correct permissions:
chmod 600 /etc/netplan/01-network-manager-all.yaml
chown root:root /etc/netplan/01-network-manager-all.yaml
- Check the configuration by running the following command:
netplan generate
If there are no errors, apply the configuration by running the following command:
netplan apply
This will apply the new network configuration and configure the network bridges with the specified settings.
- Install NFS server and client packages by running the following command:
apt install nfs-kernel-server nfs-common -y
- Create the directories for NFS mounts:
mkdir /export
mkdir -m 777 /export/primary
mkdir -m 777 /export/secondary
mkdir -m 777 /mnt/primary
mkdir -m 777 /mnt/secondary
- Set NFS exports by running the following commands:
echo "/export/secondary *(rw,async,no_root_squash,no_subtree_check)" >> /etc/exports
echo "/export/primary *(rw,async,no_root_squash,no_subtree_check)" >> /etc/exports
- Configure the NFS kernel server settings by editing the configuration file with the following command:
vim /etc/default/nfs-kernel-server
- Append the following lines to the end of the file:
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020
- Save the file and exit.
- Enable the NFS server and restart it to apply the new configuration by running the following commands:
systemctl enable nfs-kernel-server
systemctl restart nfs-kernel-server
- Mount NFS shares by running the following command:
exportfs -a
- Set up automatic NFS mounting during startup by editing the /etc/fstab file with the following command:
vim /etc/fstab
- Append the following lines to the end of the file:
$LANIP:/export/primary /mnt/primary nfs defaults 0 0
$LANIP:/export/secondary /mnt/secondary nfs defaults 0 0
Replace $LANIP with the IP address you set up in Configure Network step 3.
- Save the file and exit.
- Finally, restart systemd and mount NFS by executing the following commands:
systemctl daemon-reload
mount -a
- Install MySQL database before installing CloudStack Management with the following command:
apt install mysql-server -y
- Configure MySQL by editing the cloudstack.cnf file with the following command:
vim /etc/mysql/conf.d/cloudstack.cnf
- Add the following lines to the file:
[mysqld]
server-id=master-01
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'
- Save the file and exit.
- Enable and start the MySQL service with the following commands:
systemctl enable mysql.service
systemctl start mysql.service
- Change MySQL password by running the following commands:
mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by '$mysqlRootPassword';
exit
Replace $mysqlRootPassword with the root password you want to change
- Run the
mysql_secure_installationcommand and answer the prompts as follows:
- Enter the password you just set for the MySQL root user.
- Would you like to setup VALIDATE PASSWORD component? N
- Change the password for root? N
- Remove anonymous users? N
- Disallow root login remotely? Y
- Remove test database and access to it? Y
- Reload privilege tables now? Y
- Add the CloudStack Management package to the apt source with the following commands:
mkdir -p /etc/apt/keyrings
wget -O- http://packages.shapeblue.com/release.asc | gpg --dearmor | sudo tee /etc/apt/keyrings/cloudstack.gpg > /dev/null
echo deb [signed-by=/etc/apt/keyrings/cloudstack.gpg] http://packages.shapeblue.com/cloudstack/upstream/debian/4.20 / > /etc/apt/sources.list.d/cloudstack.list
- Update apt with the following command:
apt update
- Install CloudStack Management with the following command:
apt install cloudstack-management -y
- Set up the CloudStack database with the following command:
cloudstack-setup-databases cloud:$mysqlCloudPassword@localhost \
--deploy-as=root:$mysqlRootPassword \
-e file \
-m $managementServerKey \
-k $databaseKey \
-i $LANIP
- $mysqlCloudPassword is the password of the account created by CloudStack you need to set
- $mysqlRootPassword is the password you just set in step 6
- $managementServerKey is the management server key you need to set.
- $databaseKey is the database key you need to set.
- $LANIP is the IP address you set up in
Configure Networkstep 3.
- Complete the configuration of CloudStack Management with the following command:
cloudstack-setup-management
- Install SystemVM for CloudStack Management with the following command:
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \
-m /mnt/secondary \
-u http://download.cloudstack.org/systemvm/4.20/systemvmtemplate-4.20.1-x86_64-kvm.qcow2.bz2 \
-h kvm \
-s $managementServerKey \
-F
- $managementServerKey is the management server key you just set in step 12.
- Set sudoers to make sure everything works with the following command:
vim /etc/sudoers
- Append the following line to the end of the file:
Defaults:cloud !requiretty
- Install CloudStack agent by running the following command:
apt install cloudstack-agent -y
- Enable CloudStack Agent service with the following commands:
systemctl enable cloudstack-agent.service
- Configure QEMU by editing the qemu.conf file with the following command:
vim /etc/libvirt/qemu.conf
- Find the identifier and uncomment, change or append to the configuration:
vnc_listen = "0.0.0.0"
- Save the file and exit.
- Configure the hypervisor by editing the libvirtd.conf file with the following command:
vim /etc/libvirt/libvirtd.conf
- Find the identifier and uncomment, change or append to the configuration:
listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
auth_tcp = "none"
mdns_adv = 0
- Save the file and exit.
- Configure the hypervisor by editing the libvirtd file with the following command:
vim /etc/default/libvirtd
- Find the identifier and uncomment, change or append to the configuration:
LIBVIRTD_ARGS="--listen"
- Save the file and exit.
- Mask libvirt for listening with the following command:
systemctl mask libvirtd.socket libvirtd-ro.socket \
libvirtd-admin.socket libvirtd-tls.socket libvirtd-tcp.socketd
- Restart libvirtd to make the configuration take effect
systemctl restart libvirtd
- Disable AppArmor with the following commands:
ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
ln -s /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper /etc/apparmor.d/disable/
apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd
apparmor_parser -R /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper
Enter this URL in your browser to log in to cloudstack
$LANIP:8080
Replace $LANIP with the IP address you set up in Configure Network step 3.
Then you will see this screen Enter default account: admin and default password: password to log in
After login, you will come to this screen Press "Continue with Initlization" in the lower right corner
Cloudstack requires you to change the password for user admin Notice: If you forget your password, it will be irretrievable
Select the option "Core" and press "Next"
Select the option "Basic" and press "Next"
Please change as follows
- Name: Zone1
- IPv4 DNS1: 8.8.8.8
- IPv4 DNS2: 8.8.4.4
- Internal DNS1: 8.8.8.8
- Internal DNS2: 8.8.4.4
- Hypervisor: KVM
Then press "Next" to continue
No need to set here, press "Next"
Please change as follows
- Pod Name: Pod1
- Reserved system gateway: Please enter your $GATEWAY is what you entered in the
Configure Networkstep 3 - Reserved system netmask: Please enter your netmask, which is what you converted to $CIDR in step 3 of
Configure Network - Start/End reserved system IP: Please enter a network segment for CloudStack to use
Then press "Next" to continue
Please change as follows
- Guest gateway: Please enter your $GATEWAY is what you entered in the
Configure Networkstep 3 - Guest netmask: Please enter your netmask, which is what you converted to $CIDR in step 3 of
Configure Network - Guest start/end IP: Please enter a network segment for CloudStack to use
Then press "Next" to continue
Please change as follows
- Cluster name: Cluster1
Then press "Next" to continue
Please change as follows
- Host name: Please enter your $LANIP is what you entered in the
Configure Networkstep 3 - Username: root
- Password: Please enter your root password
If you don't know the root password, use the following commands to change root password:
passwd
Then press "Next" to continue
Please change as follows
- Name: Primary1
- Protocol: nfs
- Server: Please enter your $LANIP is what you entered in the
Configure Networkstep 3 - Path: /export/primary
Then press "Next" to continue
Please change as follows
- Protocol: NFS
- Name: Secondary1
- Server: Please enter your $LANIP is what you entered in the
Configure Networkstep 3 - Path: /export/secondary
Then press "Next" to continue
Press "Launch zone" to set the zone
After setting up the zone, click "Enable Zone".
Before creating an instance, a bootable iso must be available
Click "Images" on the left item and then click "ISOs" to come to this screen
Press "Register ISO"
After pressing "Register iso", you will come to this screen
Please change as follows
- URL: https://releases.ubuntu.com/jammy/ubuntu-22.04.5-desktop-amd64.iso
- Name: Ubuntu 22.04
- Description: Ubuntu 22.04
- OS type: Ubuntu 22.04 LTS
- Extractable: Turn On
- Public: Turn On
Then press "OK" to continue
Then wait until complete
In order to speed up, you need to add a Compute offerings setting
Click "Service offerings" on the left item and then click "Compute offerings" to come to this screen
Press "Add Compute offerings"
After pressing "Add Compute offerings", you will come to this screen
Please change as follows
- Name: Large Instance
- Description: Large Instance
- CPU cores: Adjust to your needs
- CPU (in MHz): Adjust to your needs
- Memory (in MB): Adjust to your needs
Then press "OK" to continue
Completed adding Compute offerings Now to create instance
Click "Compute" on the left item and then click "Instance" to come to this screen
Press "Add Instance"
After pressing "Add Instance", you will come to this screen
Please change as follows
- Select "ISOs" in "Template/ISO" and then select "Community"
- Select "Large Instance" in "Compute offering"
- Disk size is selected according to your needs
Then press "Launch instance" to continue After a while, you will see the instance successfully started
You can operate instance by press "View console" You need to install Ubuntu in the instance The installation process will not repeat
Now there is one instance with Ubuntu in it
The host system must be installed in UEFI mode.
You can verify the current boot mode using the following command:
test -d /proc/device-tree && echo "U-Boot mode" || (test -d /sys/firmware/efi && echo "UEFI boot mode" || echo "Legacy BIOS boot")
- Configure QEMU by editing the
qemu.conffile with the following command:
vim /etc/libvirt/qemu.conf
- Find the identifier and uncomment, change or append to the configuration:
nvram = [
"/usr/share/OVMF/OVMF_CODE_4M.fd:/usr/share/OVMF/OVMF_VARS_4M.fd",
"/usr/share/OVMF/OVMF_CODE_4M.secboot.fd:/usr/share/OVMF/OVMF_VARS_4M.fd",
"/usr/share/OVMF/OVMF_CODE_4M.ms.fd:/usr/share/OVMF/OVMF_VARS_4M.ms.fd"
]
- UEFI related params information added in
uefi.propertieswhich is located/etc/cloudstack/agent
vim /etc/cloudstack/agent/uefi.properties
- Paste the specified content into the
uefi.propertiesfile
guest.nvram.template.secure=/usr/share/OVMF/OVMF_VARS_4M.ms.fd
guest.loader.secure=/usr/share/OVMF/OVMF_CODE_4M.secboot.fd
guest.nvram.template.legacy=/usr/share/OVMF/OVMF_VARS_4M.fd
guest.loader.legacy=/usr/share/OVMF/OVMF_CODE_4M.fd
guest.nvram.path=/var/lib/libvirt/qemu/nvram/
- Restart the service using the following command:
systemctl restart libvirtd cloudstack-agent cloudstack-management
- Click on "Infrastructure" on the left side, then click on "Host" to enter this screen
- Click on the host in use to enter this screen
- Find "UEFI supported" below the "Details" section; if it shows true, it means the setup was successful
- When creating an "instance", enable "Advanced" mode and select "UEFI" as the "Boot type"
A public IP address is required to do this
- Click on "Infrastructure" on the left side, then click on "System VMs" to enter this screen
- Copy the "IP address" next to "consoleproxy"
- Go into the router and use the copied "IP address" to set up "port forwarding"
- Need to open ports
80and8080. If using HTTPS, also need to open ports443and8443
- Now, to access View Console, simply replace the "internal IP" in the URL with the "public IP"
The following items are optional because they require a domain name to use
- Click on "Configuration" on the left side, then click on "Global Settings" to enter this screen
- Search for "Consoleproxy" in the search bar
- Scroll down to find the "Consoleproxy URL domain (consoleproxy.url.domain)" item
- Enter a valid
domain name. Note that this field only accepts valid domain names and local IP addresses.
- If HTTPS connection is required, enable "Consoleproxy SSL Enabled (consoleproxy.sslEnabled)"
- After entering, press Enter and then restart the service
systemctl restart cloudstack-management
If you encounter the "Secondary not found", you can try the following steps to resolve it:
- Restart the NFS server service using the following command:
systemctl restart nfs-server.service
- Export all filesystems using the following command:
exportfs -a
- Mount all filesystems listed in
/etc/fstabusing the following command:
mount -a
- Restart the CloudStack Agent using the following command:
systemctl restart cloudstack-agent.service
- Finally, restart the Secondary SystemVM in the CloudStack Management.








































