VirtualBox修改Centos修改主机名 1.修改主机名字 hostnamectl set-hostname node1 2.修改hosts文件,vim /etc/hosts ,修改如下的内容 3.重启生效,执行reboot命令,完成配置,登陆后如图