具体步骤如下:
1、 vim /etc/default/grub
GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR=”$(sed ‘s, release .*$,,g’ /etc/system-release)” GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT=”console” GRUB_CMDLINE_LINUX=”rd.lvm.lv=rootvg/usrlv rd.lvm.lv=rootvg/swaplv crashkernel=auto vconsole.keymap=us rd.lvm.lv=rootvg/rootlv vconsole.font=latarcyrheb-sun16 rhgb quiet” GRUB_DISABLE_RECOVERY=”true”
在GRUB_CMDLINE_LINUX的最后,加上 net.ifnames=0 biosdevname=0 的参数
GRUB_CMDLINE_LINUX=”rd.lvm.lv=rootvg/usrlv rd.lvm.lv=rootvg/swaplv crashkernel=auto vconsole.keymap=us rd.lvm.lv=rootvg/rootlv vconsole.font=latarcyrheb-sun16 rhgb quiet net.ifnames=0 biosdevname=0”
2、 grub2-mkconfig -o /boot/grub2/grub.cfg
3、 mv /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-eth0
4、 reboot
对于ssh想连接虚拟机的,可以按图修改