Maxed Out Qubes? - ERROR: Cannot find unused qid!

78 views
Skip to first unread message

WhonixQubes

unread,
Apr 12, 2015, 5:15:25 PM4/12/15
to qubes...@googlegroups.com
Did I just max out Qubes?


I went to create a new AppVM and got this popup error in the VM Manager:

"ERROR: Cannot find unused qid!"



Also get the following garbage error messages in CLI using qvm-create
command. Probably a bug involved here too with the garbage error output.

$ qvm-create --label=red test

--> Using default TemplateVM: fedora-20-x64
Traceback (most recent call last):
File "/usr/bin/qvm-create", line 205, in <module>
main()
File "/usr/bin/qvm-create", line 168, in main
vm = qvm_collection.add_new_vm(vmtype, name=vmname,
template=new_vm_template, label = label)
File "/usr/lib64/python2.7/site-packages/qubes/qubes.py", line 270, in
add_new_vm
qid = self.get_new_unused_qid()
File "/usr/lib64/python2.7/site-packages/qubes/qubes.py", line 505, in
get_new_unused_qid
raise LookupError ("Cannot find unused qid!")
LookupError: Cannot find unused qid!



I believe I have a total of 254 VMs on my system, counting dom0, right
now.

Attempting to create another throws these errors.

If I first delete a VM, down to 253 VMs, I can then successfully add a
new VM without error.

Then at 254 it repeats the error if trying to add the 255th VM.

Did I just hit the max VM limit of Qubes or something? :)


WhonixQubes

WhonixQubes

unread,
Apr 12, 2015, 5:27:54 PM4/12/15
to qubes...@googlegroups.com
Ah yes found it...

Looks like I did hit the maximum number of allowed Qubes VMs: 254

In: /usr/lib64/python2.7/site-packages/qubes/qubes.py

qubes_max_qid = 254
qubes_max_netid = 254

I wonder if bad things happen if I manually increased these variables
here to go beyond 254?


Anyway, the CLI garbage error looks like an unintentional code bug.


WhonixQubes

HW42

unread,
Apr 12, 2015, 6:09:29 PM4/12/15
to WhonixQubes, qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

WhonixQubes:
Yes. The automatically assigned IPs aren't guaranteed to be unique if
you increase those IDs:

005QubesNetVm.py:99:
def get_ip_for_vm(self, qid):
lo = qid % 253 + 2
assert lo >= 2 and lo <= 254, "Wrong IP address for VM"
return self.netprefix + "{0}".format(lo)

> Anyway, the CLI garbage error looks like an unintentional code
> bug.
>
>
> WhonixQubes
>

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJVKuz8AAoJEOSsySeKZGgWAi8QAJqBTOlzwOwAl5JypGA/7VWX
RaR7sClEbJE6kjfjONjg+HCw4ZrN0lMI5Hwp7Roz/LwgiBcpHWCmch99xncFMyc0
h+axmvZn6w6LxxYJuvRAAuNFPhJfq8FG5LwLa+n4csxRhGUmwiADaV4QyxAqL33T
ck9omGlfvCUP8MKZLNTZtBWksLNLa2rRW9rTrhXDmso4W9UQmchaUVTqXQlv6G/G
GsbftR5jTrdnXlAF/TgXmudkHvSLf7UdaxSFSz1QjsXH48HzIeSBlh3npsfE3Gc4
++ZKppDRrRk3NR1k6BUIZ/GTufkMGOp2F2DChMZ0Lt2WMBsdkxaeJCDBzkfivRf8
DsPevZNN5zxr3ZfpGAeJilg0shWdD34yO+0ekj4fe7+2RtQuQYajjpNybFicrrwq
gYr7gG8v7995W+r/IuO5NZ6fqusgpJ89uobx0mkyBFiS9dWXlQXeWymBm2maIH5c
9LvOD7DmLe7Y+vQ2Ip9PqrA8aVxWRIS4VagFtL2dQ3JwZvo6GGNQgSy4GhQYsLE2
taBU8N/V2J+sxfxkP9WE/jGs3CTmNfbfWqX79j+Adb0UWwMGtiaQLbxn31bsJctt
0pSQtsPOTwJdYD/L8O1cid8qBG1KToNk2G7NqiYMMABoKC8Elp7SDm2lAWCoGLih
AX+s9qwvFS2i36vb2Bqi
=ojg8
-----END PGP SIGNATURE-----

WhonixQubes

unread,
Apr 12, 2015, 6:15:03 PM4/12/15
to hw...@ipsumj.de, qubes...@googlegroups.com
On 2015-04-12 10:09 pm, HW42 wrote:
> Yes. The automatically assigned IPs aren't guaranteed to be unique if
> you increase those IDs:
>
> 005QubesNetVm.py:99:
> def get_ip_for_vm(self, qid):
> lo = qid % 253 + 2
> assert lo >= 2 and lo <= 254, "Wrong IP address for VM"
> return self.netprefix + "{0}".format(lo)


That makes sense. I should have thought of the IP addresses.

Thanks! :)

WhonixQubes

Andrew

unread,
Apr 12, 2015, 6:30:07 PM4/12/15
to qubes...@googlegroups.com
WhonixQubes:
I'm impressed! I think you're the first to hit this limit.

I believe the QID is used to set each VM's IP address (IIRC it's the
last octet), so yes, bad things will probably happen if you manually
increase the QID. Check what happens in create_config_file in
qubes-core-admin/core-modules/000QubesVm.py.

This should be changed to GUIDs and dynamic IP allocation IMO,
especially for the VM library disaggregation I suggested here:
https://www.marc.info/?l=qubes-users&m=142417182911208&w=4

Andrew

WhonixQubes

unread,
Apr 12, 2015, 6:55:42 PM4/12/15
to kyb...@riseup.net, qubes...@googlegroups.com
On 2015-04-12 10:29 pm, Andrew wrote:
> I'm impressed! I think you're the first to hit this limit.


Cool. :)


> I believe the QID is used to set each VM's IP address (IIRC it's the
> last octet), so yes, bad things will probably happen if you manually
> increase the QID. Check what happens in create_config_file in
> qubes-core-admin/core-modules/000QubesVm.py.


Yes, correct.

To see this, in the Dom0 terminal, one can run:

qvm-ls --ids --network

The last octet of the IP is the QID + 2.

Probably to account for the dom0(?) and netvm(?), I'd imagine.


> This should be changed to GUIDs and dynamic IP allocation IMO,
> especially for the VM library disaggregation I suggested here:
> https://www.marc.info/?l=qubes-users&m=142417182911208&w=4


That does sound better.


WhonixQubes

Axon

unread,
Apr 13, 2015, 4:52:34 AM4/13/15
to WhonixQubes, kyb...@riseup.net, qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

WhonixQubes wrote:
> On 2015-04-12 10:29 pm, Andrew wrote:
>> I'm impressed! I think you're the first to hit this limit.
>
>
> Cool. :)
>

Impressive indeed. I'm sure we're all curious to know what you were
doing with so many VMs (only if you feel like sharing that
information, of course). Some sort of automated testing, perhaps?

And I thought *I* had a lot of VMs! :D

>
>> I believe the QID is used to set each VM's IP address (IIRC it's
>> the last octet), so yes, bad things will probably happen if you
>> manually increase the QID. Check what happens in
>> create_config_file in
>> qubes-core-admin/core-modules/000QubesVm.py.
>
>
> Yes, correct.
>
> To see this, in the Dom0 terminal, one can run:
>
> qvm-ls --ids --network
>
> The last octet of the IP is the QID + 2.
>
> Probably to account for the dom0(?) and netvm(?), I'd imagine.
>
>
>> This should be changed to GUIDs and dynamic IP allocation IMO,
>> especially for the VM library disaggregation I suggested here:
>> https://www.marc.info/?l=qubes-users&m=142417182911208&w=4
>
>
> That does sound better.
>
>
> WhonixQubes
>

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJVK4O+AAoJEJh4Btx1RPV8UWIP/j6UOmSUBq4+PcYqVmgd+yLO
UdqlB5A2bOypgp1tn/gf6IR+q3MoRlC8Yu/NftODoZO6QMTeI6asBFkTiE6TtM1q
2da3x7feVYzyE49a5ONB7oJQcz14dBV6KLNrc4gjgFEnwfT5G6wsPt/V2dZJGrBQ
1jUBmUmfEEGyRllbFjrh8bO9dyMQ4dFBWy0gYnTD8q8eZ2RgDPtqobp4u0yqsE64
iU5tz36tMOkSbYFXScQLANLeuv8x2TkFxmbdDlLy54RqPqTxexLyaJQ/dmbIg4cs
bR1BlKXwR/N/ehNP80pIKQos1OnR8PtXKBbFLXkIIwDmlo+frDyDFW39of0U+unX
bmNM13jROcQe68tEo2tdoIjPpubZBggp8u4HtBacpqIVblE4o6J1Tc5H0uulkipk
NIHThYNMzNAvH8q2qNdaJokBeCTKAuHLvkGLHkZUhA/wv/SXaAuSg1hUdeZqUyhy
5pKtsM4lSL63B+GVEVVRelvqPmcm7ILWIQ1CHo2Rd8e/baIUpc/N8ew6vmNjSEY3
dxzoYNAYN+Rn6Zai9XqfrVaCzL7YS0j24MD9pw7l3rWLeMuG+ZBpxpIQuN3Bc339
5PRskIdqhPp6EIiExAjJsc01CGg28HlTMXw+v0ueEI0ODWVbE/1e+n05Mbv1qI90
saSRS8BhWuvxeyxdeThJ
=HFfU
-----END PGP SIGNATURE-----

WhonixQubes

unread,
Apr 13, 2015, 1:39:12 PM4/13/15
to ax...@openmailbox.org, qubes...@googlegroups.com
On 2015-04-13 8:52 am, Axon wrote:
> Impressive indeed. I'm sure we're all curious to know what you were
> doing with so many VMs (only if you feel like sharing that
> information, of course). Some sort of automated testing, perhaps?
>
> And I thought *I* had a lot of VMs! :D


Skunkworks for now. :)

I'm using VMs in a new way.

Developing a new management engine for this as well.

I will hopefully have something to offer publicly this year.

It is pretty cool.

WhonixQubes

fowlslegs zyzzyx

unread,
May 5, 2015, 10:25:09 PM5/5/15
to qubes...@googlegroups.com, ax...@openmailbox.org, whoni...@riseup.net
>I'm using VMs in a new way. 

>Developing a new management engine for this as well. 

You should at least elaborate on this for us even if you aren't interested in full-time dev. work anymore. I had starred it and was waiting on a follow-up. Maybe me or someone else will take up the idea if we're interested in it.

Besides, it would also be nice to know you are alive. You said you would stick around as a user and it'd be comforting to know that you are at home happily working on project NEXT vs. sitting in Chicago's Homan Square with electrodes attached to your genitals :-D
Reply all
Reply to author
Forward
0 new messages