====== Boot - Shutdown Server PC and virtual machines ======
===== Virtual Machines =====
* **Shutdown**
- If we want to shutdown virtual machines without shutting down server PC then [[en:software:lserver-admin:quickstart:connect2server|we connect to Server HY to proxmox]]
* **Warning!** __We do not connect from a PC that was booted from network__ because our login session is running on the virtual machines we want to shutdown and we will lose connection. We connect either from a **PC with local installation and local user** or from Server PC itself.
- On the left pane we select **Datacenter** and double click on **hosta**. We can see here the running virtual machines.
- To **shutdown** a virtual machine we have 3 ways.
- **(Normal shutdown)**. We right click on the virtual machine and select **Shutdown**. What this does to a virtual machine is equivalent to pressing power button for a second only on a normal PC to send a shutdown command.
- **(Normal shutdown)**. If above procedure doesn't work, we right click on it, select **Console** to open a VNC Console and do a shutdown **from within the OS** of the virtual machine.
- **(Abnormal shutdown)**. To shutdown abnormally (poweroff) a virtual machine, if for example it has frozen, we click on **Stop** button. What this does to a virtual machine is equivalent to pressing power button on a normal PC for many seconds until it cuts power. **Reset** button on a virtual machine is equivalent to reset button on a normal PC.
* **Boot**
* Το **boot** a virtual machine We right click on the virtual machine and select **Start** or we left click to select it and click on the Start button in the up right.
Server vm - **lserver** boots always **first** and after it finishes booting, the rest vms start. With similar logic it is the **last** vm to shut down after all other vms have stopped
===== Server PC =====
* **Boot**
* **Locally** : We start Server PC normally by pressing **power** button. It is configured to start all virtual machines automatically in the correct order.
* **Shutdown**
* **Locally** : We can safely give **shutdown command even from power button** by pressing it lightly for a second. Server will shutdown virtual machines in the right order and then shutdown itself.
* **Remotely** : [[en:software:lserver-admin:quickstart:connect2server|We connect to Server PC to proxmox]], select **hosta** and from the button on the up row we click on **Shutdown**
* **Restart**
* **Remotely** : [[en:software:lserver-admin:quickstart:connect2server|We connect to Server PC to proxmox]], select **hosta** and from the button on the up row we click on **Restart**
If possible, it is recommended to __shutdown virtual machines__ **before shutting down or restart Server PC**. Virtual machines can be automatically shutdown from Server PC when it shuts down or reboot, however it may fail to gracefully shutdown the vms and shut them down abnormally after 2 minutes risking data loss.