After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 765175 - Windows 8.1 express installation fails due to the hostname
Windows 8.1 express installation fails due to the hostname
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: windows
3.20.x
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-04-17 12:35 UTC by Fabiano Fidêncio
Modified: 2016-05-05 14:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
unattended-installer: Avoid invalid char on hostname (1.22 KB, patch)
2016-04-17 12:37 UTC, Fabiano Fidêncio
none Details | Review
Avoid invalid char on hostname (1.38 KB, patch)
2016-05-02 07:18 UTC, Fabiano Fidêncio
committed Details | Review

Description Fabiano Fidêncio 2016-04-17 12:35:32 UTC
The reason is that Microsoft doesn't allow to set a host name that contains any of the following characters: {|}~[\]^':; <=>?@!"#$%`()+/.,*&

For testing Windows 8.1 express installation you'll need the following patch: https://www.redhat.com/archives/libosinfo/2016-April/msg00000.html
Comment 1 Fabiano Fidêncio 2016-04-17 12:37:00 UTC
Created attachment 326195 [details] [review]
unattended-installer: Avoid invalid char on hostname
Comment 2 Zeeshan Ali 2016-04-18 17:59:54 UTC
Hmm.. I thought this was fixed long time ago in bug#677391 but i guess win8.1 is even more strict.
Comment 3 Fabiano Fidêncio 2016-04-18 18:09:31 UTC
(In reply to Zeeshan Ali (Khattak) from comment #2)
> Hmm.. I thought this was fixed long time ago in bug#677391 but i guess
> win8.1 is even more strict.

Probably as strict as the Windows 8.1. The main thing here is that Boxes uses as guest hostname, the same domain name used by libvirt which is, AFAIU, the short-id provided by libosinfo.
So, Windows 8.1 was the first one where we had to deal with a dot, probably the problem exists on Windows 7 as well.
Comment 4 Zeeshan Ali 2016-04-18 18:09:46 UTC
Review of attachment 326195 [details] [review]:

Shortlog makes it sound like hostname is invalid in general. How about: More acceptable hostname for win? (Feel free to shorten "unattended-installer" to just "unattended".

So this applies to all Windows as the description says?

::: src/unattended-installer.vala
@@ +125,2 @@
     public override void prepare_to_continue_installation (string vm_name) {
+        this.hostname = replace_regex(vm_name, "[{|}~[\\]^':; <=>?@!\"#$%`()+/.,*&]", "-");

* Not sure '-' will be accepted by all windows so better just replace with ""?

* Now that this is getting complicated, I think libosinfo should tell us the accepted hostname format, like it does for product key. So if you are not doing that in libsoinfo, we should at least have a FIXME comment here about that.
Comment 5 Fabiano Fidêncio 2016-04-18 18:15:52 UTC
(In reply to Zeeshan Ali (Khattak) from comment #4)
> Review of attachment 326195 [details] [review] [review]:
> 
> Shortlog makes it sound like hostname is invalid in general. How about: More
> acceptable hostname for win? (Feel free to shorten "unattended-installer" to
> just "unattended".
> 
> So this applies to all Windows as the description says?

I do think so. I'll do some quick tests with Windows7 and Windows10 as well.

> 
> ::: src/unattended-installer.vala
> @@ +125,2 @@
>      public override void prepare_to_continue_installation (string vm_name) {
> +        this.hostname = replace_regex(vm_name, "[{|}~[\\]^':;
> <=>?@!\"#$%`()+/.,*&]", "-");
> 
> * Not sure '-' will be accepted by all windows so better just replace with
> ""?

Yep. I do agree.

> 
> * Now that this is getting complicated, I think libosinfo should tell us the
> accepted hostname format, like it does for product key. So if you are not
> doing that in libsoinfo, we should at least have a FIXME comment here about
> that.

I'd go for both solutions, Zeeshan.
My patch for Boxes can go in now with the FIXME note (and maybe only doing that for Windows guests?) meanwhile I work on libosinfo solution. This way it will be way easier for backporting the fix for whatever distro that wants to have it fixed :-)

Does it work for you?
Comment 6 Zeeshan Ali 2016-04-19 10:39:10 UTC
(In reply to Fabiano Fidêncio from comment #5)
> (In reply to Zeeshan Ali (Khattak) from comment #4)
> > Review of attachment 326195 [details] [review] [review] [review]:
> > 
> >
> > 
> > * Now that this is getting complicated, I think libosinfo should tell us the
> > accepted hostname format, like it does for product key. So if you are not
> > doing that in libsoinfo, we should at least have a FIXME comment here about
> > that.
> 
> I'd go for both solutions, Zeeshan.
> My patch for Boxes can go in now with the FIXME note (and maybe only doing
> that for Windows guests?) meanwhile I work on libosinfo solution. This way
> it will be way easier for backporting the fix for whatever distro that wants
> to have it fixed :-)
> 
> Does it work for you?

Yeah sure but we don't need to make this temporary solution just for windows.
Comment 7 Fabiano Fidêncio 2016-05-02 07:18:44 UTC
Created attachment 327132 [details] [review]
Avoid invalid char on hostname
Comment 8 Zeeshan Ali 2016-05-05 12:15:51 UTC
Review of attachment 327132 [details] [review]:

Just some nits that you can fix before pushing.

* We're avoid invalid characters, not just a character.

* While it wouldn't take a genius to figure out you mean Microsoft Windows here, best keep it super obvious by writing the full name.

::: src/unattended-installer.vala
@@ +125,3 @@
     public override void prepare_to_continue_installation (string vm_name) {
+        /*
+         * A valid hostname format must be provided by libosinfo.

must -> should. :)
Comment 9 Fabiano Fidêncio 2016-05-05 14:06:58 UTC
Pushed, thanks.