During remote access t o server with muti os, you may want to switch between different OS, it is impossible if you want to make it by manully select grub menus in this scenario, so cant this be achived? Of course No, you just use the grub-reboot command to make it, here we go.
first, please execute the command "sudo grub-reboot #NO", Which NO means the items you want to bootup in grub bootup menu.
for example
sudo grub-reboot 3
![](https://img-blog.csdnimg.cn/img_convert/989f3fba5425957a1fb4e3adc7a5c2c1.png)
then reboot the system with command
sudo reboot
Then you will find the items 3(start from item 0) system was seleted and taken as the default system to boot.
![](https://img-blog.csdnimg.cn/img_convert/2349b1c4b9a6d8cc2bfba14c9760c2a8.png)
afther this, you will bootup the system you want, event if you are in a remote access.
在包含submenu的情境下,比如,要启动的系统在高级菜单里面,可以通过如下字符串的形式提供启动信息,可以通过执行如下命令:
sudo grub-reboot "Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-137-generic"
注意,命令行参数要和/boot/grub/grub.cfg文件中的描述完全一致才可以。
sudo grub-reboot "Advanced options for Ubuntu>Ubuntu, with Linux 5.15.0-58-generic"
![](https://img-blog.csdnimg.cn/img_convert/742da0438f5a3e2dfb10f65149ad79bb.png)
或则用数字序号代替,
sudo grub-reboot '1>6'
sudo reboot
'1>6'前一个1代表主菜单的第一项入口,也就是Advanced options for Ubuntu,后面的6表示第子菜单的第六项启动,也就是我们选择的启动内核。主,子菜单序号都从0开始记。