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

Comments

6 participants
@entr0py

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?

@unman

This comment has been minimized.

Show comment
Hide comment
@unman

unman Nov 8, 2016

Member

@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.)

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

This comment has been minimized.

Show comment
Hide comment
@jpouellet

jpouellet Nov 11, 2016

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@unman

unman Nov 11, 2016

Member

@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.

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

This comment has been minimized.

Show comment
Hide comment
@jpouellet

jpouellet Nov 11, 2016

Contributor

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.

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

Use ..._dm instead of ...-dm
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

Use ..._dm instead of ...-dm
This is to avoid possible name conflicts with VMs created via the
qubes-manager gui.

See: QubesOS/qubes-issues#2422
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Nov 11, 2016

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.

Member

marmarek commented Nov 11, 2016

-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

This comment has been minimized.

Show comment
Hide comment
@jpouellet

jpouellet Nov 25, 2016

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 ..."

Contributor

jpouellet commented Nov 25, 2016

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

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Nov 25, 2016

Member

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

Member

marmarek commented Nov 25, 2016

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

marmarek added a commit to QubesOS/qubes-core-admin that referenced this issue Mar 14, 2017

Don't allow VM name ending in -dm
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)

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status Mar 16, 2017

Closed

core-admin v3.2.13 (r3.2) #13

marmarta added a commit to marmarta/qubes-manager that referenced this issue Jul 13, 2018

Fixed VM name validation in GUI tools (Create VM, Settings, Manager)
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

Fixed VM name validation in GUI tools (Create VM, Settings, Manager)
VM name validation in various places in Manager did not allow a
perfectly legal '_' character.

references QubesOS/qubes-issues#2422
@marmarta

This comment has been minimized.

Show comment
Hide comment
@marmarta

marmarta Jul 13, 2018

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)

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 marmarta closed this Jul 13, 2018

marmarta added a commit to marmarta/qubes-manager that referenced this issue Jul 13, 2018

Fixed VM name validation in GUI tools (Create VM, Settings, Manager)
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

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status Jul 18, 2018

Open

manager v4.0.19 (r4.0) #600

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment