Menu

How to set system memory

The following is an example of changing the memory size of a virtual machine from 12 GB to 10 GB

1.Right click on "This Computer" on the Windows desktop of the industrial intelligent computer, click on "Properties" to view the current memory size allocated to Windows.

2.Log in to the real-time system of the industrial intelligent computer, full name of iComputer, refer to the documentation.

3.Check the grub file for the hugepages parameter

  • View grub file

     

cat /etc/default/grub

  • If there is a hugepages parameter, change the value of the hugepages parameter in the grub file to 10G, keyboard "i" to enter edit mode, "esc" to exit edit mode, ":wq" to save and exit

sudo virsh list --all

  • Check the grub file. If the hugepages parameter does not exist, the grub file does not need to be modified.

4.Check the virtual machine name

sudo virsh list --all

As shown in the figure, it can be seen that the name of the virtual machine is win10. This step must be checked, and the virtual machine name is different for different systems. The specific virtual machine name viewed in the machine shall prevail

5.Forcefully shut down the virtual machine (if the virtual machine name viewed in step 3 is not win10, replace win10 in the command with the virtual machine name actually viewed in step 3)

sudo virsh destroy win10   

 

6.Edit virtual machine configuration file

cd /etc/libvirt/qemu
sudo cp win10_default.xml win10_default.xml.bk   
sudo vim win10_default.xml

  • After opening the '{Virtual Machine Name}_default.xml' file, you can view the memory size of the virtual machine. If the current memory size of the machine is 12GB, it needs to be changed to 10G.
  • The values in two places in the image need to be modified to 10485760 (calculation method: 10G=10 * 1024 * 1024KB=10485760KB). The keyboard "i" enters the editing mode, "esc" exits the editing mode, and ":wq" saves and exits

7.Define virtual machines

sudo virsh define win10_default.xml

8.Restart the machine after the above settings are set or the machine is powered off and restarted

sudo reboot

9.Right click on "This Computer" on the Windows desktop and click on "Properties" to check if the memory size has been successfully modified (for safety reasons, you can also check after the machine is powered off and restarted)

Last modified: 2024-11-14