vmd/vmctl: allow to boot cdrom-only VMs

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

vmd/vmctl: allow to boot cdrom-only VMs

Reyk Floeter-2
Hi,

vmctl doesn't allow to boot VMs with only a CDROM.  I see no reason
for it and vmd already allows CDROM-only.

OK?

Via https://twitter.com/wizardishungry/status/1032327323125727232
"Jon Williams @wizardishungry
@reykfloeter Could you consider allowing booting ISO-only vms in 6.4?
This is helpful for running container hosts (e.g. boot2docker)."

Reyk

Index: usr.sbin/vmctl/vmctl.c
===================================================================
RCS file: /cvs/src/usr.sbin/vmctl/vmctl.c,v
retrieving revision 1.54
diff -u -p -u -p -r1.54 vmctl.c
--- usr.sbin/vmctl/vmctl.c 12 Jul 2018 12:04:49 -0000 1.54
+++ usr.sbin/vmctl/vmctl.c 22 Aug 2018 18:29:44 -0000
@@ -98,8 +98,8 @@ vm_start(uint32_t start_id, const char *
  errx(1, "too many disks");
  else if (ndisks == 0)
  warnx("starting without disks");
- if (kernel == NULL && ndisks == 0)
- errx(1, "no kernel or disk specified");
+ if (kernel == NULL && ndisks == 0 && !iso)
+ errx(1, "no kernel or disk/cdrom specified");
  if (nnics == -1)
  nnics = 0;
  if (nnics > VMM_MAX_NICS_PER_VM)

Reply | Threaded
Open this post in threaded view
|

Re: vmd/vmctl: allow to boot cdrom-only VMs

Mike Larkin
On Wed, Aug 22, 2018 at 08:35:23PM +0200, Reyk Floeter wrote:
> Hi,
>
> vmctl doesn't allow to boot VMs with only a CDROM.  I see no reason
> for it and vmd already allows CDROM-only.
>
> OK?

No objection, ok mlarkin.

-ml

>
> Via https://twitter.com/wizardishungry/status/1032327323125727232
> "Jon Williams @wizardishungry
> @reykfloeter Could you consider allowing booting ISO-only vms in 6.4?
> This is helpful for running container hosts (e.g. boot2docker)."
>
> Reyk
>
> Index: usr.sbin/vmctl/vmctl.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/vmctl/vmctl.c,v
> retrieving revision 1.54
> diff -u -p -u -p -r1.54 vmctl.c
> --- usr.sbin/vmctl/vmctl.c 12 Jul 2018 12:04:49 -0000 1.54
> +++ usr.sbin/vmctl/vmctl.c 22 Aug 2018 18:29:44 -0000
> @@ -98,8 +98,8 @@ vm_start(uint32_t start_id, const char *
>   errx(1, "too many disks");
>   else if (ndisks == 0)
>   warnx("starting without disks");
> - if (kernel == NULL && ndisks == 0)
> - errx(1, "no kernel or disk specified");
> + if (kernel == NULL && ndisks == 0 && !iso)
> + errx(1, "no kernel or disk/cdrom specified");
>   if (nnics == -1)
>   nnics = 0;
>   if (nnics > VMM_MAX_NICS_PER_VM)
>

Reply | Threaded
Open this post in threaded view
|

Re: vmd/vmctl: allow to boot cdrom-only VMs

Klemens Nanni-2
In reply to this post by Reyk Floeter-2
On Wed, Aug 22, 2018 at 08:35:23PM +0200, Reyk Floeter wrote:
> vmctl doesn't allow to boot VMs with only a CDROM.  I see no reason
> for it and vmd already allows CDROM-only.
I don't see a reason not to support this - wanted to test boot some
linux CD myself already but failed without disk.

OK kn

Reply | Threaded
Open this post in threaded view
|

Re: vmd/vmctl: allow to boot cdrom-only VMs

Carlos Cardenas
In reply to this post by Reyk Floeter-2
On Wed, Aug 22, 2018 at 08:35:23PM +0200, Reyk Floeter wrote:
> Hi,
>
> vmctl doesn't allow to boot VMs with only a CDROM.  I see no reason
> for it and vmd already allows CDROM-only.
>
> OK?

ok ccardenas

Reply | Threaded
Open this post in threaded view
|

Re: vmd/vmctl: allow to boot cdrom-only VMs

Todd T. Fries-2
In reply to this post by Reyk Floeter-2
This makes me wonder. Does it make sense to support booting a kernel without
disks?  Some people have heard of the phrase 'diskless' ;-)

Penned by Reyk Floeter on 20180822 13:35.23, we have:
| Hi,
|
| vmctl doesn't allow to boot VMs with only a CDROM.  I see no reason
| for it and vmd already allows CDROM-only.
|
| OK?
|
| Via https://twitter.com/wizardishungry/status/1032327323125727232
| "Jon Williams @wizardishungry
| @reykfloeter Could you consider allowing booting ISO-only vms in 6.4?
| This is helpful for running container hosts (e.g. boot2docker)."
|
| Reyk
|
| Index: usr.sbin/vmctl/vmctl.c
| ===================================================================
| RCS file: /cvs/src/usr.sbin/vmctl/vmctl.c,v
| retrieving revision 1.54
| diff -u -p -u -p -r1.54 vmctl.c
| --- usr.sbin/vmctl/vmctl.c 12 Jul 2018 12:04:49 -0000 1.54
| +++ usr.sbin/vmctl/vmctl.c 22 Aug 2018 18:29:44 -0000
| @@ -98,8 +98,8 @@ vm_start(uint32_t start_id, const char *
|   errx(1, "too many disks");
|   else if (ndisks == 0)
|   warnx("starting without disks");
| - if (kernel == NULL && ndisks == 0)
| - errx(1, "no kernel or disk specified");
| + if (kernel == NULL && ndisks == 0 && !iso)
| + errx(1, "no kernel or disk/cdrom specified");
|   if (nnics == -1)
|   nnics = 0;
|   if (nnics > VMM_MAX_NICS_PER_VM)

--
Todd T. Fries . http://todd.fries.net/pgp.txt . @unix2mars . github:toddfries

Reply | Threaded
Open this post in threaded view
|

Re: vmd/vmctl: allow to boot cdrom-only VMs

Klemens Nanni-2
On Thu, Aug 23, 2018 at 11:05:40AM -0500, Todd T. Fries wrote:
> This makes me wonder. Does it make sense to support booting a kernel without
> disks?  Some people have heard of the phrase 'diskless' ;-)
We already do:

        $ head -n4 /etc/vm.conf
        vm "rd" {
                disable
                memory 128M
                boot /bsd.rd
        }
        $ vmctl start rd -c

That way I can quickly test things in the installer, screw with modified
images, etc.

Reply | Threaded
Open this post in threaded view
|

Re: vmd/vmctl: allow to boot cdrom-only VMs

Mike Larkin
In reply to this post by Todd T. Fries-2
On Thu, Aug 23, 2018 at 11:05:40AM -0500, Todd T. Fries wrote:

> This makes me wonder. Does it make sense to support booting a kernel without
> disks?  Some people have heard of the phrase 'diskless' ;-)
>
> Penned by Reyk Floeter on 20180822 13:35.23, we have:
> | Hi,
> |
> | vmctl doesn't allow to boot VMs with only a CDROM.  I see no reason
> | for it and vmd already allows CDROM-only.
> |
> | OK?
> |
> | Via https://twitter.com/wizardishungry/status/1032327323125727232
> | "Jon Williams @wizardishungry
> | @reykfloeter Could you consider allowing booting ISO-only vms in 6.4?
> | This is helpful for running container hosts (e.g. boot2docker)."
> |
> | Reyk
> |
> | Index: usr.sbin/vmctl/vmctl.c
> | ===================================================================
> | RCS file: /cvs/src/usr.sbin/vmctl/vmctl.c,v
> | retrieving revision 1.54
> | diff -u -p -u -p -r1.54 vmctl.c
> | --- usr.sbin/vmctl/vmctl.c 12 Jul 2018 12:04:49 -0000 1.54
> | +++ usr.sbin/vmctl/vmctl.c 22 Aug 2018 18:29:44 -0000
> | @@ -98,8 +98,8 @@ vm_start(uint32_t start_id, const char *
> |   errx(1, "too many disks");
> |   else if (ndisks == 0)
> |   warnx("starting without disks");
> | - if (kernel == NULL && ndisks == 0)
> | - errx(1, "no kernel or disk specified");
> | + if (kernel == NULL && ndisks == 0 && !iso)
> | + errx(1, "no kernel or disk/cdrom specified");
> |   if (nnics == -1)
> |   nnics = 0;
> |   if (nnics > VMM_MAX_NICS_PER_VM)
>
> --
> Todd T. Fries . http://todd.fries.net/pgp.txt . @unix2mars . github:toddfries
>

I know personally of at least 3 people using vmm(4)/vmd(8) with gigantisch
ramdisks containing all sorts of goo. None of them use any disks.

-ml

Reply | Threaded
Open this post in threaded view
|

Re: vmd/vmctl: allow to boot cdrom-only VMs

Theo de Raadt-2
Mike Larkin <[hidden email]> wrote:

> On Thu, Aug 23, 2018 at 11:05:40AM -0500, Todd T. Fries wrote:
> > This makes me wonder. Does it make sense to support booting a kernel without
> > disks?  Some people have heard of the phrase 'diskless' ;-)
> >
> > Penned by Reyk Floeter on 20180822 13:35.23, we have:
> > | Hi,
> > |
> > | vmctl doesn't allow to boot VMs with only a CDROM.  I see no reason
> > | for it and vmd already allows CDROM-only.
> > |
> > | OK?
> > |
> > | Via https://twitter.com/wizardishungry/status/1032327323125727232
> > | "Jon Williams @wizardishungry
> > | @reykfloeter Could you consider allowing booting ISO-only vms in 6.4?
> > | This is helpful for running container hosts (e.g. boot2docker)."
> > |
> > | Reyk
> > |
> > | Index: usr.sbin/vmctl/vmctl.c
> > | ===================================================================
> > | RCS file: /cvs/src/usr.sbin/vmctl/vmctl.c,v
> > | retrieving revision 1.54
> > | diff -u -p -u -p -r1.54 vmctl.c
> > | --- usr.sbin/vmctl/vmctl.c 12 Jul 2018 12:04:49 -0000 1.54
> > | +++ usr.sbin/vmctl/vmctl.c 22 Aug 2018 18:29:44 -0000
> > | @@ -98,8 +98,8 @@ vm_start(uint32_t start_id, const char *
> > |   errx(1, "too many disks");
> > |   else if (ndisks == 0)
> > |   warnx("starting without disks");
> > | - if (kernel == NULL && ndisks == 0)
> > | - errx(1, "no kernel or disk specified");
> > | + if (kernel == NULL && ndisks == 0 && !iso)
> > | + errx(1, "no kernel or disk/cdrom specified");
> > |   if (nnics == -1)
> > |   nnics = 0;
> > |   if (nnics > VMM_MAX_NICS_PER_VM)
> >
> > --
> > Todd T. Fries . http://todd.fries.net/pgp.txt . @unix2mars . github:toddfries
> >
>
> I know personally of at least 3 people using vmm(4)/vmd(8) with gigantisch
> ramdisks containing all sorts of goo. None of them use any disks.

but no AFS in sight.


Reply | Threaded
Open this post in threaded view
|

Re: vmd/vmctl: allow to boot cdrom-only VMs

Todd T. Fries-2
Penned by Theo de Raadt on 20180823 14:22.46, we have:
| Mike Larkin <[hidden email]> wrote:
|
| > On Thu, Aug 23, 2018 at 11:05:40AM -0500, Todd T. Fries wrote:
| > > This makes me wonder. Does it make sense to support booting a kernel without
| > > disks?  Some people have heard of the phrase 'diskless' ;-)
| > >
| > > Penned by Reyk Floeter on 20180822 13:35.23, we have:
| > > | Hi,
| > > |
| > > | vmctl doesn't allow to boot VMs with only a CDROM.  I see no reason
| > > | for it and vmd already allows CDROM-only.
| > > |
| > > | OK?
| > > |
| > > | Via https://twitter.com/wizardishungry/status/1032327323125727232
| > > | "Jon Williams @wizardishungry
| > > | @reykfloeter Could you consider allowing booting ISO-only vms in 6.4?
| > > | This is helpful for running container hosts (e.g. boot2docker)."
| > > |
| > > | Reyk
| > > |
| > > | Index: usr.sbin/vmctl/vmctl.c
| > > | ===================================================================
| > > | RCS file: /cvs/src/usr.sbin/vmctl/vmctl.c,v
| > > | retrieving revision 1.54
| > > | diff -u -p -u -p -r1.54 vmctl.c
| > > | --- usr.sbin/vmctl/vmctl.c 12 Jul 2018 12:04:49 -0000 1.54
| > > | +++ usr.sbin/vmctl/vmctl.c 22 Aug 2018 18:29:44 -0000
| > > | @@ -98,8 +98,8 @@ vm_start(uint32_t start_id, const char *
| > > |   errx(1, "too many disks");
| > > |   else if (ndisks == 0)
| > > |   warnx("starting without disks");
| > > | - if (kernel == NULL && ndisks == 0)
| > > | - errx(1, "no kernel or disk specified");
| > > | + if (kernel == NULL && ndisks == 0 && !iso)
| > > | + errx(1, "no kernel or disk/cdrom specified");
| > > |   if (nnics == -1)
| > > |   nnics = 0;
| > > |   if (nnics > VMM_MAX_NICS_PER_VM)
| > >
| > > --
| > > Todd T. Fries . http://todd.fries.net/pgp.txt . @unix2mars . github:toddfries
| > >
| >
| > I know personally of at least 3 people using vmm(4)/vmd(8) with gigantisch
| > ramdisks containing all sorts of goo. None of them use any disks.
|
| but no AFS in sight.
|

vmd(8) doesn't have a fdc(4) either, so no swapping on a floppy!

--
Todd T. Fries . http://todd.fries.net/pgp.txt . @unix2mars . github:toddfries

Reply | Threaded
Open this post in threaded view
|

Re: vmd/vmctl: allow to boot cdrom-only VMs

Reyk Floeter-2
In reply to this post by Todd T. Fries-2
Hi,

it’s not like that, maybe I wasn’t clear. Let me try to explain:

- you can boot from disk (-d)
- you can boot an OpenBSD kernel or use a custom BIOS (-b)
- you can boot from CDROM (-r)

vmd/vmctl checks if at least one option is available.

If you specify neither of these options, you can potentially boot from network or via telekinesis. But vmd doesn’t support network boot (only with a PXE BIOS payload that conflicts with sgabios) and I cannot judge your telekinesis skills to make a VM boot without any kernel.

Reyk

> Am 23.08.2018 um 18:05 schrieb Todd T. Fries <[hidden email]>:
>
> This makes me wonder. Does it make sense to support booting a kernel without
> disks?  Some people have heard of the phrase 'diskless' ;-)
>
> Penned by Reyk Floeter on 20180822 13:35.23, we have:
> | Hi,
> |
> | vmctl doesn't allow to boot VMs with only a CDROM.  I see no reason
> | for it and vmd already allows CDROM-only.
> |
> | OK?
> |
> | Via https://twitter.com/wizardishungry/status/1032327323125727232
> | "Jon Williams @wizardishungry
> | @reykfloeter Could you consider allowing booting ISO-only vms in 6.4?
> | This is helpful for running container hosts (e.g. boot2docker)."
> |
> | Reyk
> |
> | Index: usr.sbin/vmctl/vmctl.c
> | ===================================================================
> | RCS file: /cvs/src/usr.sbin/vmctl/vmctl.c,v
> | retrieving revision 1.54
> | diff -u -p -u -p -r1.54 vmctl.c
> | --- usr.sbin/vmctl/vmctl.c    12 Jul 2018 12:04:49 -0000    1.54
> | +++ usr.sbin/vmctl/vmctl.c    22 Aug 2018 18:29:44 -0000
> | @@ -98,8 +98,8 @@ vm_start(uint32_t start_id, const char *
> |              errx(1, "too many disks");
> |          else if (ndisks == 0)
> |              warnx("starting without disks");
> | -        if (kernel == NULL && ndisks == 0)
> | -            errx(1, "no kernel or disk specified");
> | +        if (kernel == NULL && ndisks == 0 && !iso)
> | +            errx(1, "no kernel or disk/cdrom specified");
> |          if (nnics == -1)
> |              nnics = 0;
> |          if (nnics > VMM_MAX_NICS_PER_VM)
>
> --
> Todd T. Fries . http://todd.fries.net/pgp.txt . @unix2mars . github:toddfries