Fix hostname setting also in Debian, part N

Port #2384 / #2383 for Debian guests. Fixes #2443.

This should really be DRY'ed up...