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 676834 - A few express installation fixes/improvements
A few express installation fixes/improvements
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: installer
unspecified
Other All
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-05-25 18:27 UTC by Zeeshan Ali
Modified: 2016-03-31 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
express,winxp,win2k3: Set display resolution & depth (3.39 KB, patch)
2012-05-25 18:27 UTC, Zeeshan Ali
rejected Details | Review
express: Set hostname in guest based on its box's name (10.07 KB, patch)
2012-05-25 18:27 UTC, Zeeshan Ali
reviewed Details | Review
express,winxp,win2k3: Admin password required (2.14 KB, patch)
2012-05-25 18:27 UTC, Zeeshan Ali
reviewed Details | Review
express,winxp,fedora: Setup user's avatar (28.03 KB, patch)
2012-05-25 18:27 UTC, Zeeshan Ali
accepted-commit_now Details | Review
express,winxp,win2k3: Set display resolution & depth (3.39 KB, patch)
2012-05-25 18:38 UTC, Zeeshan Ali
rejected Details | Review
express: Set hostname in guest based on its box's name (10.07 KB, patch)
2012-05-25 18:38 UTC, Zeeshan Ali
none Details | Review
express,winxp,win2k3: Admin password required (2.14 KB, patch)
2012-05-25 18:39 UTC, Zeeshan Ali
none Details | Review
express,winxp,fedora: Setup user's avatar (28.03 KB, patch)
2012-05-25 18:39 UTC, Zeeshan Ali
committed Details | Review
express: Set hostname in guest based on its box's name (9.88 KB, patch)
2012-05-25 20:35 UTC, Zeeshan Ali
committed Details | Review
express,winxp,win2k3: Admin password required (2.20 KB, patch)
2012-05-25 20:35 UTC, Zeeshan Ali
committed Details | Review
express,winxp,fedora: Setup user's avatar (28.03 KB, patch)
2012-05-25 20:36 UTC, Zeeshan Ali
committed Details | Review
Store box name as an UnattendedInstaller property (6.28 KB, patch)
2012-05-26 19:00 UTC, Christophe Fergeau
none Details | Review
Store box name as an UnattendedInstaller property (7.76 KB, patch)
2012-05-26 20:16 UTC, Christophe Fergeau
reviewed Details | Review
Store box name as an UnattendedInstaller property (7.58 KB, patch)
2012-05-28 14:38 UTC, Christophe Fergeau
none Details | Review

Description Zeeshan Ali 2012-05-25 18:27:01 UTC
Here are a few express installation fixes/improvements.
Comment 1 Zeeshan Ali 2012-05-25 18:27:03 UTC
Created attachment 214971 [details] [review]
express,winxp,win2k3: Set display resolution & depth

Although according to documentation[1], this should simple work but it
doesn't. :(

[1] http://unattended.msfn.org/unattended.xp/view/web/19/#display
Comment 2 Zeeshan Ali 2012-05-25 18:27:06 UTC
Created attachment 214972 [details] [review]
express: Set hostname in guest based on its box's name
Comment 3 Zeeshan Ali 2012-05-25 18:27:08 UTC
Created attachment 214973 [details] [review]
express,winxp,win2k3: Admin password required

We need to set admin password to "*" to unset it. The same is not true
for 'net' commandline we use to setup user account so we need to do
admin password substitution differently for Windows XP and 2003.
Comment 4 Zeeshan Ali 2012-05-25 18:27:12 UTC
Created attachment 214974 [details] [review]
express,winxp,fedora: Setup user's avatar

We show the user's avatar in the express install setup as if it'll be
used so its very disapointing for user when its not. This patch fixes
that for Windows XP and Fedora.
Comment 5 Marc-Andre Lureau 2012-05-25 18:30:08 UTC
Review of attachment 214971 [details] [review]:

this is a bad approach imho, as it won't fit in maximized (default) or window-size. Also using primary monitor size is perhaps not what is wanted.

Spice handles resolution switching depending on window size. If you take driver & agent from git for windows, it's already pixel precise, and there is no scaling needed.
Comment 6 Marc-Andre Lureau 2012-05-25 18:37:39 UTC
Review of attachment 214972 [details] [review]:

::: src/unattended-installer.vala
@@ +169,3 @@
     }
 
+    public virtual string fill_unattended_data (string data, string hostname) throws RegexError {

You could call an overridable get_hostname() method instead of passing an additional argument,  /me think
Comment 7 Zeeshan Ali 2012-05-25 18:38:48 UTC
Created attachment 214976 [details] [review]
express,winxp,win2k3: Set display resolution & depth

Rebased on current master.
Comment 8 Zeeshan Ali 2012-05-25 18:38:59 UTC
Created attachment 214977 [details] [review]
express: Set hostname in guest based on its box's name

Rebased on current master.
Comment 9 Marc-Andre Lureau 2012-05-25 18:39:08 UTC
Review of attachment 214973 [details] [review]:

"We need to set admin password to "*" to unset it"

Is that something documented? If it is, it would be great you give a reference to the doc.
Or am I getting this wrong?
Comment 10 Zeeshan Ali 2012-05-25 18:39:17 UTC
Created attachment 214978 [details] [review]
express,winxp,win2k3: Admin password required

Rebased on current master.
Comment 11 Zeeshan Ali 2012-05-25 18:39:36 UTC
Created attachment 214979 [details] [review]
express,winxp,fedora: Setup user's avatar

Rebased on current master.
Comment 12 Marc-Andre Lureau 2012-05-25 18:40:37 UTC
Review of attachment 214974 [details] [review]:

I trust it works, ack
Comment 13 Zeeshan Ali 2012-05-25 18:48:35 UTC
(In reply to comment #6)
> Review of attachment 214972 [details] [review]:
> 
> ::: src/unattended-installer.vala
> @@ +169,3 @@
>      }
> 
> +    public virtual string fill_unattended_data (string data, string hostname)
> throws RegexError {
> 
> You could call an overridable get_hostname() method instead of passing an
> additional argument,  /me think

hostname doesn't come from sublcasses but from the caller (VMCreator) through the setup() call. I don't like having this passed around either but i didn't see any better alternative.

(In reply to comment #9)
> Review of attachment 214973 [details] [review]:
> 
> "We need to set admin password to "*" to unset it"
> 
> Is that something documented? If it is, it would be great you give a reference
> to the doc.
> Or am I getting this wrong?

http://unattended.msfn.org/unattended.xp/view/web/19/#guiunattended and I found it out after getting an error about this from installer. I even tried having just "" as value but that trick didn't help either. Seems we must put a *. OTOH I tried if the same could work for user password but in the context of 'net' commandline '*' means that you want to enter password interactively.
Comment 14 Zeeshan Ali 2012-05-25 18:50:12 UTC
(In reply to comment #12)
> Review of attachment 214974 [details] [review]:
> 
> I trust it works, ack

Yeah, it took a while to get it working but it does work. I was hoping for getting it to work for win7 as well but thats not trivial either and I must look into other things (e.g crashes) before spending more time on this..
Comment 15 Zeeshan Ali 2012-05-25 19:05:59 UTC
(In reply to comment #5)
> Review of attachment 214971 [details] [review]:
> 
> this is a bad approach imho,

As I mentioned in the log, this doesn't work at all so it was more like to get others' feedback/suggestion.

> as it won't fit in maximized (default) or

When i set the resolution to the resolution of my display, it fits fine in maximized mode.

> window-size.

Why wouldn't it work? It would be a separate bug if we can't scale as per Boxes window size.

> Also using primary monitor size is perhaps not what is wanted.
> 
> Spice handles resolution switching depending on window size. If you take driver
> & agent from git for windows, it's already pixel precise, and there is no
> scaling needed.

Does that take care of setting the default resolution appropriately? The problem I'm trying to fix here is to set some default resolution that doesn't look as ugly as 800x600 (the default).
Comment 16 Zeeshan Ali 2012-05-25 20:35:14 UTC
Created attachment 215002 [details] [review]
express: Set hostname in guest based on its box's name

Rebased after removal of attachment#214976 [details].
Comment 17 Zeeshan Ali 2012-05-25 20:35:37 UTC
Created attachment 215003 [details] [review]
express,winxp,win2k3: Admin password required

Link to docs added.
Comment 18 Zeeshan Ali 2012-05-25 20:36:23 UTC
Created attachment 215005 [details] [review]
express,winxp,fedora: Setup user's avatar

Rebased after removal of attachment#214976 [details]
Comment 19 Marc-Andre Lureau 2012-05-25 21:28:21 UTC
Review of attachment 215002 [details] [review]:

ack
Comment 20 Marc-Andre Lureau 2012-05-25 21:28:28 UTC
Review of attachment 215003 [details] [review]:

ack
Comment 21 Marc-Andre Lureau 2012-05-25 21:28:34 UTC
Review of attachment 215005 [details] [review]:

ack
Comment 22 Marc-Andre Lureau 2012-05-25 21:38:26 UTC
(In reply to comment #15)
> As I mentioned in the log, this doesn't work at all so it was more like to get
> others' feedback/suggestion.

Ok

> > as it won't fit in maximized (default) or
> 
> When i set the resolution to the resolution of my display, it fits fine in
> maximized mode.

It will be scaled down. In window maximized, the gnome panel still occupy space, so the guest resolution is scaled to fit.

What is perhaps needed is an equivalent of spicec/virt-viewer --full-screen=autoconf at the spice level (something like sending current display settings when connecting). Trying to set the default display during installation doesn't help much, since as soon as spice is resized and/or change resolution, it will be forgotten.

> Does that take care of setting the default resolution appropriately? The
> problem I'm trying to fix here is to set some default resolution that doesn't
> look as ugly as 800x600 (the default).

It will look "ugly" as long as it is scaled. But with a pixel-exact resolution, thanks to latest driver & agent, it doesn't. Setting a resolution differently won't last.
Comment 23 Zeeshan Ali 2012-05-26 00:24:27 UTC
Attachment 214979 [details] pushed as 2c3ba93 - express,winxp,fedora: Setup user's avatar
Attachment 215002 [details] pushed as b2575a8 - express: Set hostname in guest based on its box's name
Attachment 215003 [details] pushed as c96bbe1 - express,winxp,win2k3: Admin password required
Attachment 215005 [details] pushed as 2c3ba93 - express,winxp,fedora: Setup user's avatar
Comment 24 Christophe Fergeau 2012-05-26 19:00:21 UTC
Created attachment 215056 [details] [review]
Store box name as an UnattendedInstaller property

This allows to make the code setting the host name in unattended
files much less convoluted.
Comment 25 Christophe Fergeau 2012-05-26 19:07:14 UTC
Comment on attachment 215005 [details] [review]
express,winxp,fedora: Setup user's avatar

>Subject: [PATCH] express,winxp,fedora: Setup user's avatar
>     protected override string fill_unattended_data (string data, string hostname) throws RegexError {
>-        var host = hostname.replace (" ", "-");
>-        var str = base.fill_unattended_data (data, host);
>+        var str = base.fill_unattended_data (data, hostname);

This didn't belong there :-/

>-        var avatar_file = "/var/lib/AccountsService/icons/" + username;
>+        var avatar_file = new UnattendedAvatarFile (this, "/var/lib/AccountsService/icons/" + username, avatar_format);

How much of an internal AccountsService detail is "/var/lib/AccountsService/icons/"? Are applications supposed to be poking there?
Comment 26 Christophe Fergeau 2012-05-26 20:16:56 UTC
Created attachment 215065 [details] [review]
Store box name as an UnattendedInstaller property

This allows to make the code setting the host name in unattended
files much less convoluted.
Comment 27 Zeeshan Ali 2012-05-27 15:35:26 UTC
Review of attachment 215065 [details] [review]:

I don't like this approach either as vm_name property doesn't exactly fit into UnattendedInstaller. Instead of getting hostname from outside (VMCreator), perhaps it'd be better if UnattendedInstaller.setup takes vm_name as argument instead and create hostname from it internally (i-e half of your approach)? If we'd need more of the VM properties later, we can always create domain configuration before the UnattendedInstaller.setup and pass that around instead.
Comment 28 Christophe Fergeau 2012-05-28 14:30:35 UTC
(In reply to comment #27)
> I don't like this approach either as vm_name property doesn't exactly fit into
> UnattendedInstaller. Instead of getting hostname from outside (VMCreator),
> perhaps it'd be better if UnattendedInstaller.setup takes vm_name as argument
> instead and create hostname from it internally (i-e half of your approach)?

Fine with me. I can also call the property "system_name" and derive hostname from there, this is slightly more future-proof if we ever need this system name in other places. But I'm fine with doing 
this.hostname = m_name.replace (" ", "-"); 
in UnattendedInstaller::setup

> If
> we'd need more of the VM properties later, we can always create domain
> configuration before the UnattendedInstaller.setup and pass that around
> instead.

I don't know which functions you have in mind for this passing around, but I think the UnattendedFile classes should not have knowledge at all of the VM configuration. Ideally, UnattendedTextFile would not hardcode a call to UnattendedInstaller::fill_unattended_data but instead we'd have a UnattendedTextFile:set_line_filter  method and UnattendedTextFile would call this callback for each line when set. Too clueless about vala to do that myself though ;)
Comment 29 Christophe Fergeau 2012-05-28 14:38:02 UTC
Created attachment 215130 [details] [review]
Store box name as an UnattendedInstaller property

This allows to make the code setting the host name in unattended
files much less convoluted.
Comment 30 Zeeshan Ali 2012-05-28 15:05:31 UTC
(In reply to comment #28)
> (In reply to comment #27)
> > I don't like this approach either as vm_name property doesn't exactly fit into
> > UnattendedInstaller. Instead of getting hostname from outside (VMCreator),
> > perhaps it'd be better if UnattendedInstaller.setup takes vm_name as argument
> > instead and create hostname from it internally (i-e half of your approach)?
> 
> Fine with me. I can also call the property "system_name" and derive hostname
> from there, this is slightly more future-proof if we ever need this system name
> in other places. But I'm fine with doing 
> this.hostname = m_name.replace (" ", "-"); 
> in UnattendedInstaller::setup

Its less about what you call it but more about where it belongs. This information just doesn't belong here. Having said that, we can think of it as a cache so not really a big deal I guess.

> > If
> > we'd need more of the VM properties later, we can always create domain
> > configuration before the UnattendedInstaller.setup and pass that around
> > instead.
> 
> I don't know which functions you have in mind for this passing around,

The same ones that pass it around right now.

> but I
> think the UnattendedFile classes should not have knowledge at all of the VM
> configuration.

I don't agree. These classes are very much related: While GVirDomain.Config is configuration of the VM, these classes are setting-up configuration of the guest for that VM. Its pretty logical IMHO for guest configuration to be based on VM configuration.

OTOH, UnattendedInstaller classes shouldn't have any knowledge about VM configuration. So if you have any suggestion on how we can fix that, that would be awesome!
Comment 31 Christophe Fergeau 2012-05-28 15:50:17 UTC
(In reply to comment #30)

> 
> Its less about what you call it but more about where it belongs. This
> information just doesn't belong here. Having said that, we can think of it as a
> cache so not really a big deal I guess.

There are already username, password, timezone, keyboard properties in UnattendedInstaller, I don't see hostname as being different there. Whether all these things belong in UnattendedInstaller or in a VMConfiguration object is a different question ;)

> 
> > but I
> > think the UnattendedFile classes should not have knowledge at all of the VM
> > configuration.
> 
> I don't agree. These classes are very much related: While GVirDomain.Config is
> configuration of the VM, these classes are setting-up configuration of the
> guest for that VM. Its pretty logical IMHO for guest configuration to be based
> on VM configuration.

"These classes" ? The various UnattendedFile classes? I see them as simple wrapper around a source file to be mcopied to a floppy image, with some basic transformation to be applied during the copy. One of these classes happen to have an hardcoded callback into UnattendedInstaller, callback which may need VM configuration. I don't think we should use this as a pretext to make all UnattendedFile classes require this vm configuration. On the contrary we should see how we can avoid having some hardcoded callback and use something more generic to make UnattendedFile as standalone as possible. 
Then classes can be built that use UnattendedFile as a tool, and these classes will know about VM configuration. But UnattendedFile is far too basic to be seen as something more than a helper class.

> 
> OTOH, UnattendedInstaller classes shouldn't have any knowledge about VM
> configuration. 

There are plenty of things UnattendedInstaller shouldn't do... But I'm not going into cleaning that up...