MachineName of Windows hosts

Hi!

Context: Windows 11 Pro, Duplicati - 2.1.0.2_beta_2024-11-29

The MachineName created upon installation of a new host seems to be taken from the Windows Registry (Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName), which doesn’t reflect the full computer name. This name is truncated to 15 characters and raised to uppercase.
This MachineName is then used during the registration process into the Console WebApp.
Apart from cosmetic considerations there are obvious operational/support reasons to see the full computer name in the list of the registered machines in the Console WebApp. So, would it be possible to have the registration process to use the full computer name, taken for instance from within this Registry key: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

This is because we use System.Environment.MachineName which on Windows returns the NetBIOS name of the machine, which is limited to 15 chars.

Here is the actual interop and underlying call and finaly

Out of curiosity, I wonder if you can try to ping “Fred-VM-Win11Pro” from another machine in the network, or just “FRED-VM-WIN11PR” is reachable.

@kenkendk

@marceloduplicati
Thank you.
I am running multiple VMs (2 on macOS, 1 on Win11), each of them alone on their own network. NetBIOS is not routable so I cannot do what you asked.

Similarly, the issue is the same with macOS. You seem to use the NetBIOS name which can lead to odd names. I have uneven results on the way the NetBIOS name is defined by macOS. You seem to take the output of the hostname -s command which in effect is the NetBIOS name (truncated to 15 chars).
On macOS, the full computer name is got from scutil --get ComputerName and you could use scutil --get LocalHostName to build up the machine-name during the registration process in the Console webapp. See screenshots below.

More importantly though: the registration into the Console webapp is relying on the machineid. I did a test:

  • I registered machineA with abcd1234 as machine-id
  • I decided to rename machineA to machineB from an OS perspective.
  • Obviously nothing changed in the console.
  • I unregistered the machine, ie proper unregister from the Host and delete the registered machine in the Console
  • I re-registered the machine
  • And guess what? The machine reappearing on the Console is still named MachineA with the same machineid

So the unregister process in the Console doesn’t clean up things as it should.

Indeed uneven results on MacOS.

On one of my macs, Sonoma 14.3 M3, I’ve renamed to test

Environment.MachineName = “Marcelos-MacBook-Pro” which is 19 bytes long, so not a NetBios capped name
scutil --get ComputerName = “Marcelo’s MacBook Pro”
scutil --get LocalHostName = “Marcelos-MacBook-Pro”

So the unregister process in the Console doesn’t clean up things as it should.

I found two caching issues around that, one on the backend and one on frontend. I will definitely have a further look on these issues. Thanks.

Yes, that is a good idea. I have registered an issue for this.