这可能与将18.04 LTS作为虚拟机运行(主机是Win 2016 DC)有关,但我不知道如何实现。我尝试过各种已知的更改主机名的方法,但是它始终会还原为在重新启动计算机时构建的主机名。我尝试了以下方法:
- hostnamectl set-hostname xxx。
- 直接编辑主机名。
- 将--static添加到hostnamectl。
- 编辑主机文件并添加所需的主机名。
- 重新启动之前,在驱动器中搜索对旧主机名的引用。
- 我在互联网上发现的其他一些奇怪的建议不值得一提。
我目前没有此服务器的DNS。
例:
XXXX@iwrxmail:~# hostnamectl
Static hostname: iwrxmail
Pretty hostname: Interwrx Ubuntu Mail Server
Transient hostname: ctl
Icon name: computer-vm
Chassis: vm
Machine ID: 01ef0d836d2c4945b51a4fab8e506381
Boot ID: e6608fe238d843f883cde52af7631a79
Virtualization: microsoft
Operating System: Ubuntu 18.04 LTS
Kernel: Linux 4.15.0-20-generic
Architecture: x86-64
XXXX@iwrxmail:~# hostnamectl set-hostname test
XXXX@iwrxmail:~# hostnamectl
Static hostname: test
Icon name: computer-vm
Chassis: vm
Machine ID: 01ef0d836d2c4945b51a4fab8e506381
Boot ID: e6608fe238d843f883cde52af7631a79
Virtualization: microsoft
Operating System: Ubuntu 18.04 LTS
Kernel: Linux 4.15.0-20-generic
Architecture: x86-64
root@iwrxmail:~# cat /etc/hostname
test
root@iwrxmail:~# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
However on reboot I get this again ....
XXXX@iwrxmail:~# hostnamectl
Static hostname: iwrxmail
Icon name: computer-vm
Chassis: vm
Machine ID: 01ef0d836d2c4945b51a4fab8e506381
Boot ID: 25a00676b22048eb8d43492c9de4f147
Virtualization: microsoft
Operating System: Ubuntu 18.04 LTS
Kernel: Linux 4.15.0-20-generic
Architecture: x86-64
我在Beta版本18.04中遇到了这个问题,但是我认为我会等待发行副本。我还认为克隆虚拟机可能是一个问题,但这是一个刚刚发行的发行版从头开始构建的全新版本。
我想念什么?
提前致谢。