Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy in handling of periods in VM names #2422

Closed
entr0py opened this issue Nov 7, 2016 · 8 comments · Fixed by QubesOS/qubes-core-admin#72
Closed

Discrepancy in handling of periods in VM names #2422

entr0py opened this issue Nov 7, 2016 · 8 comments · Fixed by QubesOS/qubes-core-admin#72
Labels
C: core C: manager/widget T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.

Comments

@entr0py
Copy link

entr0py commented Nov 7, 2016

Qubes 3.1

VM Manager does not allow creation of VM's with period in name.
qvm-create allows periods.

Will using a period in VM name cause any issues?

@andrewdavidwong andrewdavidwong added T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. C: core C: manager/widget labels Nov 8, 2016
@andrewdavidwong andrewdavidwong added this to the Release 3.2 milestone Nov 8, 2016
@unman
Copy link
Member

unman commented Nov 8, 2016

@3n7r0p1 Yes, there's a discrepancy - it's not the only one. You can also use underscore with qvm-create, but not in Manager. The regexes are slightly different. I don't think it matters. (The command line often offers greater control.)

Yes, using a period will cause issues. DNS uses the period as a delimiter between labels, and various system elements will expect this to be the case. Trivially, the standard prompt will appear as user@a rather than user@a.b . Generally, anything that interacts with DNS will break. Don't do it. (This isn't specific to Qubes.)

@jpouellet
Copy link
Contributor

jpouellet commented Nov 11, 2016

Additionally underscores are allowed in vm names but not allowed in the creation gui.
https://github.com/QubesOS/qubes-core-admin/blob/master/core-modules/000QubesVm.py#L572

Thought: Reserving a special character not able to be created in the gui would allow qubes-internal VMs (such as foo-dm for HVMs) to never conflict with user-specified domains. This would mean using foo_dm instead of foo-dm as the auto-generated domain for the 'foo' HVM.

@unman
Copy link
Member

unman commented Nov 11, 2016

@jpouellet Not clear on your proposal -I think you must mean reserving characters that cant be used in gui AND command line? Otherwise you will still have potential for conflict with user-specified names.

@jpouellet
Copy link
Contributor

jpouellet commented Nov 11, 2016

Not really a proposal so much as an observation.

If I create an HVM named "foo", and a pvm named "foo-dm", and start "foo", then I will be unable to start "foo-dm", because the name is already used internally by qubes. Instead, you get this unhelpful (if you don't already know why) error message:
hvmfail

Qubes internally using _dm instead of -dm would avoid this problem, because users in the gui can not create VMs named ..._dm.

Users on the command line are assumed to not be bothered by such minor user experience things.

jpouellet added a commit to jpouellet/qubes-manager that referenced this issue Nov 11, 2016
This is to avoid possible name conflicts with VMs created via the
qubes-manager gui.

See: QubesOS/qubes-issues#2422
jpouellet added a commit to jpouellet/qubes-core-admin that referenced this issue Nov 11, 2016
This is to avoid possible name conflicts with VMs created via the
qubes-manager gui.

See: QubesOS/qubes-issues#2422
@marmarek
Copy link
Member

-dm suffix is hardcoded in Xen toolstack, so not something we could easily change. Much easier thing to do for this particular problem, would be to prevent VM to have -dm suffix.

@jpouellet
Copy link
Contributor

This issue isn't really resolved and IMO is not ready to be closed. There is still a discrepancy in periods (as the OP was about).

There was a reason my commit said "Partially fixes ..."

@marmarek marmarek reopened this Nov 25, 2016
@marmarek
Copy link
Member

github: "Partially fixes" still matches "fixes" ;)

marmarek pushed a commit to QubesOS/qubes-core-admin that referenced this issue Mar 14, 2017
This is used internally for device-model stubdomains (untrusted qemu)
for HVMs, and causes conflicts when trying to boot foo (HVM) and foo-dm
(any type).

Partially fixes QubesOS/qubes-issues#2422

(cherry picked from commit c4f30bc)
marmarta added a commit to marmarta/qubes-manager that referenced this issue Jul 13, 2018
VM name validation in various places in Manager did not allow
perfectly legal otherwise '_' and '.' characters.

references QubesOS/qubes-issues#2422
marmarta added a commit to marmarta/qubes-manager that referenced this issue Jul 13, 2018
VM name validation in various places in Manager did not allow a
perfectly legal '_' character.

references QubesOS/qubes-issues#2422
@marmarta
Copy link
Member

I've made it more consistent:

  • in R3.2, where dot is allowed in VM names, it will now be also allowed in GUI tools
  • in R4.0, where dot is not allowed in VM names, it will not be allowed in GUI tools (but underscore, that should have been allowed but wasn't, will be)

marmarta added a commit to marmarta/qubes-manager that referenced this issue Jul 13, 2018
VM name validation in various places in Manager did not allow
perfectly legal otherwise '_' and '.' characters.

references QubesOS/qubes-issues#2422
fixes QubesOS/qubes-issues#3301
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: core C: manager/widget T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants