但是改变文件夹名称后,同时需要改变容器文件夹中的config文件所对应的相应文件夹。
引用
# Template used to create this container: /usr/share/lxc/templates/lxc-ubuntu
# Parameters passed to the template:
# For additional config options, please look at lxc.container.conf(5)
# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf
# Container specific configuration
#下面两行必须改变
lxc.rootfs = /var/lib/lxc/python3/rootfs
lxc.mount = /var/lib/lxc/python3/fstab
#可以随意
lxc.utsname = ipython3
lxc.arch = amd64
# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.hwaddr = 00:16:3e:0a:b4:3d
# Parameters passed to the template:
# For additional config options, please look at lxc.container.conf(5)
# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf
# Container specific configuration
#下面两行必须改变
lxc.rootfs = /var/lib/lxc/python3/rootfs
lxc.mount = /var/lib/lxc/python3/fstab
#可以随意
lxc.utsname = ipython3
lxc.arch = amd64
# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.hwaddr = 00:16:3e:0a:b4:3d
然后进入rootfs/etc文件夹,改变hostname文件host名称