I have a fresh install of Rocky Linux 8 “Server GUI” as a VM on a Synology NAS (using the Synology Virtual Machine Manager). It is running nicely – but I do not know how to “network” the Linux VM:
When I type hostname in Terminal I get localhost.localdomain back. How can I change that name - and how can that changed name then be seen from the host (the Synology NAS)?
Also when I type curl https://httpbin.org I get “Could not resolve host”, so the networking clearly is noyt setup correctly. How can I pass the network from the outside to the RL VM?
The default network config does request configuration from DHCP server for the interface.
If there is DHCP and DNS set up, the client (VM) would get all, including hostname.
There is hostnamectl to see/set name. However, the name that machine calls itself is not important. It is the other machines, where you use a name and need to get that resolved into IP address. DNS is the common way to handle the resolutions for whole networks.
So, the Synology should either have local config (e.g. /etc/hosts) to map a name to IP address of the VM, or get that mapping done by the DNS servers that it does use.
“Could not resolve host” in the VM? Like above, the VM has to first resolve the “httpbin.org” into IP address. If it has DNS configured, then it either fails to connect to that DNS server, or that server does not know that name.
nmcli should show most of current network config.
It is up to the Synology, how/if it offers “virtual” network between the VM and everything else.