Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #202186 > unrolled thread

Installing Debian with preseed file using qemu

Started byjohn doe <johndoe65534@mail.com>
First post2018-11-06 15:10 +0100
Last post2018-11-09 07:20 +0100
Articles 8 — 2 participants

Back to article view | Back to linux.debian.user


Contents

  Installing Debian with preseed file using qemu john doe <johndoe65534@mail.com> - 2018-11-06 15:10 +0100
    Re: Installing Debian with preseed file using qemu Reco <recoverym4n@enotuniq.net> - 2018-11-06 16:10 +0100
      Re: Installing Debian with preseed file using qemu john doe <johndoe65534@mail.com> - 2018-11-06 17:10 +0100
        Re: Installing Debian with preseed file using qemu john doe <johndoe65534@mail.com> - 2018-11-06 20:50 +0100
          Re: Installing Debian with preseed file using qemu Reco <recoverym4n@enotuniq.net> - 2018-11-07 07:30 +0100
            Re: Installing Debian with preseed file using qemu john doe <johndoe65534@mail.com> - 2018-11-07 14:30 +0100
              Re: Installing Debian with preseed file using qemu Reco <recoverym4n@enotuniq.net> - 2018-11-07 15:00 +0100
                Re: Installing Debian with preseed file using qemu john doe <johndoe65534@mail.com> - 2018-11-09 07:20 +0100

#202186 — Installing Debian with preseed file using qemu

Fromjohn doe <johndoe65534@mail.com>
Date2018-11-06 15:10 +0100
SubjectInstalling Debian with preseed file using qemu
Message-ID<wRadk-2x2-17@gated-at.bofh.it>
Hi,

I'm trying to install Debian Stretch using a preseeding file.
All of this is with Qemu and  I'm not sure how  to pass the path of the
preseed file:

qemu-system-x86_64 -drive file=debian.img,format=raw -cdrom
debian-9.5.0-amd64-netinst.iso -boot d -nographic -kernel vmlinuz
-append "console=ttyS0,115200n8 auto=true priority=critical
DEBIAN_FRONTEND=text preseed=preseed.cfg" -initrd initrd.gz

The d-i can not find the preseed.cfg file, as anyone has any idea on how
I can install Debian with a preseed file using qemu?

If I can avoid fiddling around with initdr.gz it's even better! :)

-- 
John Doe

[toc] | [next] | [standalone]


#202194

FromReco <recoverym4n@enotuniq.net>
Date2018-11-06 16:10 +0100
Message-ID<wRb9o-35R-9@gated-at.bofh.it>
In reply to#202186
	Hi.

On Tue, Nov 06, 2018 at 03:04:25PM +0100, john doe wrote:
> Hi,
> 
> I'm trying to install Debian Stretch using a preseeding file.
> All of this is with Qemu and  I'm not sure how  to pass the path of the
> preseed file:
> 
> qemu-system-x86_64 -drive file=debian.img,format=raw -cdrom
> debian-9.5.0-amd64-netinst.iso -boot d -nographic -kernel vmlinuz
> -append "console=ttyS0,115200n8 auto=true priority=critical
> DEBIAN_FRONTEND=text preseed=preseed.cfg" -initrd initrd.gz
> 
> The d-i can not find the preseed.cfg file, as anyone has any idea on how
> I can install Debian with a preseed file using qemu?

Since you do not specify "-net", that means "-net user".
As [1] shows us, "-net user" comes with built-in TFTP server.

So, you either replace your "-kernel", "-initrd" and "-append" with TFTP
invocation, and install Debian as if it was installed from TFTP.
Or rebuild d-i initrd to include your preseed.cfg.

Reco

[toc] | [prev] | [next] | [standalone]


#202200

Fromjohn doe <johndoe65534@mail.com>
Date2018-11-06 17:10 +0100
Message-ID<wRc5s-3EH-9@gated-at.bofh.it>
In reply to#202194
On 11/6/2018 4:02 PM, Reco wrote:
> 	Hi.
>
> On Tue, Nov 06, 2018 at 03:04:25PM +0100, john doe wrote:
>> Hi,
>>
>> I'm trying to install Debian Stretch using a preseeding file.
>> All of this is with Qemu and  I'm not sure how  to pass the path of the
>> preseed file:
>>
>> qemu-system-x86_64 -drive file=debian.img,format=raw -cdrom
>> debian-9.5.0-amd64-netinst.iso -boot d -nographic -kernel vmlinuz
>> -append "console=ttyS0,115200n8 auto=true priority=critical
>> DEBIAN_FRONTEND=text preseed=preseed.cfg" -initrd initrd.gz
>>
>> The d-i can not find the preseed.cfg file, as anyone has any idea on how
>> I can install Debian with a preseed file using qemu?
>
> Since you do not specify "-net", that means "-net user".
> As [1] shows us, "-net user" comes with built-in TFTP server.
>
> So, you either replace your "-kernel", "-initrd" and "-append" with TFTP
> invocation, and install Debian as if it was installed from TFTP.
> Or rebuild d-i initrd to include your preseed.cfg.
>

Thank you, I didn't think to install debian using PXE with qemu acting
as tftp server.

--
John Doe

[toc] | [prev] | [next] | [standalone]


#202211

Fromjohn doe <johndoe65534@mail.com>
Date2018-11-06 20:50 +0100
Message-ID<wRfwl-5xs-1@gated-at.bofh.it>
In reply to#202200
On 11/6/2018 5:05 PM, john doe wrote:
> On 11/6/2018 4:02 PM, Reco wrote:
>> 	Hi.
>>
>> On Tue, Nov 06, 2018 at 03:04:25PM +0100, john doe wrote:
>>> Hi,
>>>
>>> I'm trying to install Debian Stretch using a preseeding file.
>>> All of this is with Qemu and  I'm not sure how  to pass the path of the
>>> preseed file:
>>>
>>> qemu-system-x86_64 -drive file=debian.img,format=raw -cdrom
>>> debian-9.5.0-amd64-netinst.iso -boot d -nographic -kernel vmlinuz
>>> -append "console=ttyS0,115200n8 auto=true priority=critical
>>> DEBIAN_FRONTEND=text preseed=preseed.cfg" -initrd initrd.gz
>>>
>>> The d-i can not find the preseed.cfg file, as anyone has any idea on how
>>> I can install Debian with a preseed file using qemu?
>>
>> Since you do not specify "-net", that means "-net user".
>> As [1] shows us, "-net user" comes with built-in TFTP server.
>>
>> So, you either replace your "-kernel", "-initrd" and "-append" with TFTP
>> invocation, and install Debian as if it was installed from TFTP.
>> Or rebuild d-i initrd to include your preseed.cfg.
>>
> 
> Thank you, I didn't think to install debian using PXE with qemu acting
> as tftp server.
> 

Ok -- I have downloaded/extracted netboot.tar.gz and I use the following
command:

"qemu-system-x86_64" -drive file=debian.img,format=raw -m 8126 -accel
hax   -machine q35 -boot n -device e1000,netdev=n1 -netdev
user,id=n1,tftp=$PWD,bootfile=/pxelinux.0 -nographic

I get the error "could not read the boot disk".

Any thoughts on what I'm missing?

-- 
John Doe

[toc] | [prev] | [next] | [standalone]


#202215

FromReco <recoverym4n@enotuniq.net>
Date2018-11-07 07:30 +0100
Message-ID<wRpvH-3fi-1@gated-at.bofh.it>
In reply to#202211
	Hi.

On Tue, Nov 06, 2018 at 08:44:08PM +0100, john doe wrote:
> On 11/6/2018 5:05 PM, john doe wrote:
> > On 11/6/2018 4:02 PM, Reco wrote:
> >> 	Hi.
> >>
> >> On Tue, Nov 06, 2018 at 03:04:25PM +0100, john doe wrote:
> >>> Hi,
> >>>
> >>> I'm trying to install Debian Stretch using a preseeding file.
> >>> All of this is with Qemu and  I'm not sure how  to pass the path of the
> >>> preseed file:
> >>>
> >>> qemu-system-x86_64 -drive file=debian.img,format=raw -cdrom
> >>> debian-9.5.0-amd64-netinst.iso -boot d -nographic -kernel vmlinuz
> >>> -append "console=ttyS0,115200n8 auto=true priority=critical
> >>> DEBIAN_FRONTEND=text preseed=preseed.cfg" -initrd initrd.gz
> >>>
> >>> The d-i can not find the preseed.cfg file, as anyone has any idea on how
> >>> I can install Debian with a preseed file using qemu?
> >>
> >> Since you do not specify "-net", that means "-net user".
> >> As [1] shows us, "-net user" comes with built-in TFTP server.
> >>
> >> So, you either replace your "-kernel", "-initrd" and "-append" with TFTP
> >> invocation, and install Debian as if it was installed from TFTP.
> >> Or rebuild d-i initrd to include your preseed.cfg.
> >>
> > 
> > Thank you, I didn't think to install debian using PXE with qemu acting
> > as tftp server.
> > 
> 
> Ok -- I have downloaded/extracted netboot.tar.gz and I use the following
> command:
> 
> "qemu-system-x86_64" -drive file=debian.img,format=raw -m 8126 -accel
> hax   -machine q35 -boot n -device e1000,netdev=n1 -netdev
> user,id=n1,tftp=$PWD,bootfile=/pxelinux.0 -nographic
> 
> I get the error "could not read the boot disk".
> 
> Any thoughts on what I'm missing?

Both tcpdump and strace outputs? I know, I know ;)

This does not look right; "bootfile=/pxelinux.0".
You're assumed to have pxelinux binary, its libraries, pxelinux.cfg, etc
in the same directory, and to point QEMU there.

Reco

[toc] | [prev] | [next] | [standalone]


#202224

Fromjohn doe <johndoe65534@mail.com>
Date2018-11-07 14:30 +0100
Message-ID<wRw4a-76R-7@gated-at.bofh.it>
In reply to#202215
On 11/7/2018 7:26 AM, Reco wrote:
> 	Hi.
> 
> On Tue, Nov 06, 2018 at 08:44:08PM +0100, john doe wrote:
>> On 11/6/2018 5:05 PM, john doe wrote:
>>> On 11/6/2018 4:02 PM, Reco wrote:
>>>> 	Hi.
>>>>
>>>> On Tue, Nov 06, 2018 at 03:04:25PM +0100, john doe wrote:
>>>>> Hi,
>>>>>
>>>>> I'm trying to install Debian Stretch using a preseeding file.
>>>>> All of this is with Qemu and  I'm not sure how  to pass the path of the
>>>>> preseed file:
>>>>>
>>>>> qemu-system-x86_64 -drive file=debian.img,format=raw -cdrom
>>>>> debian-9.5.0-amd64-netinst.iso -boot d -nographic -kernel vmlinuz
>>>>> -append "console=ttyS0,115200n8 auto=true priority=critical
>>>>> DEBIAN_FRONTEND=text preseed=preseed.cfg" -initrd initrd.gz
>>>>>
>>>>> The d-i can not find the preseed.cfg file, as anyone has any idea on how
>>>>> I can install Debian with a preseed file using qemu?
>>>>
>>>> Since you do not specify "-net", that means "-net user".
>>>> As [1] shows us, "-net user" comes with built-in TFTP server.
>>>>
>>>> So, you either replace your "-kernel", "-initrd" and "-append" with TFTP
>>>> invocation, and install Debian as if it was installed from TFTP.
>>>> Or rebuild d-i initrd to include your preseed.cfg.
>>>>
>>>
>>> Thank you, I didn't think to install debian using PXE with qemu acting
>>> as tftp server.
>>>
>>
>> Ok -- I have downloaded/extracted netboot.tar.gz and I use the following
>> command:
>>
>> "qemu-system-x86_64" -drive file=debian.img,format=raw -m 8126 -accel
>> hax   -machine q35 -boot n -device e1000,netdev=n1 -netdev
>> user,id=n1,tftp=$PWD,bootfile=/pxelinux.0 -nographic
>>
>> I get the error "could not read the boot disk".
>>
>> Any thoughts on what I'm missing?
> 
> Both tcpdump and strace outputs? I know, I know ;)
> 
> This does not look right; "bootfile=/pxelinux.0".
> You're assumed to have pxelinux binary, its libraries, pxelinux.cfg, etc
> in the same directory, and to point QEMU there.
> 

Taking care of the symlink I now get:

  [Link:up, TX:0 TXE:0 RX:0 RXE:0]
Configuring (net0 52:54:00:12:34:56)..... ok
net0: 10.0.2.15/255.255.255.0 gw 10.0.2.2
Next server: 10.0.2.2
Filename: /pxelinux.0
tftp://10.0.2.2//pxelinux.0... ok
pxelinux.0 : 80 bytes [PXE-NBP]


Looks like the command is working, what I need to understand is how to
configure Debian netbooting using pxe.
So I guess my question is:

Other then netboot.gz (downloaded and extracted), what else do I need?

Or am I on the rong track and where should I start?

-- 
John Doe

[toc] | [prev] | [next] | [standalone]


#202226

FromReco <recoverym4n@enotuniq.net>
Date2018-11-07 15:00 +0100
Message-ID<wRwxb-7gK-1@gated-at.bofh.it>
In reply to#202224
	Hi.

On Wed, Nov 07, 2018 at 02:27:32PM +0100, john doe wrote:
> On 11/7/2018 7:26 AM, Reco wrote:
> > 	Hi.
> > 
> > On Tue, Nov 06, 2018 at 08:44:08PM +0100, john doe wrote:
> >> On 11/6/2018 5:05 PM, john doe wrote:
> >>> On 11/6/2018 4:02 PM, Reco wrote:
> >>>> 	Hi.
> >>>>
> >>>> On Tue, Nov 06, 2018 at 03:04:25PM +0100, john doe wrote:
> >>>>> Hi,
> >>>>>
> >>>>> I'm trying to install Debian Stretch using a preseeding file.
> >>>>> All of this is with Qemu and  I'm not sure how  to pass the path of the
> >>>>> preseed file:
> >>>>>
> >>>>> qemu-system-x86_64 -drive file=debian.img,format=raw -cdrom
> >>>>> debian-9.5.0-amd64-netinst.iso -boot d -nographic -kernel vmlinuz
> >>>>> -append "console=ttyS0,115200n8 auto=true priority=critical
> >>>>> DEBIAN_FRONTEND=text preseed=preseed.cfg" -initrd initrd.gz
> >>>>>
> >>>>> The d-i can not find the preseed.cfg file, as anyone has any idea on how
> >>>>> I can install Debian with a preseed file using qemu?
> >>>>
> >>>> Since you do not specify "-net", that means "-net user".
> >>>> As [1] shows us, "-net user" comes with built-in TFTP server.
> >>>>
> >>>> So, you either replace your "-kernel", "-initrd" and "-append" with TFTP
> >>>> invocation, and install Debian as if it was installed from TFTP.
> >>>> Or rebuild d-i initrd to include your preseed.cfg.
> >>>>
> >>>
> >>> Thank you, I didn't think to install debian using PXE with qemu acting
> >>> as tftp server.
> >>>
> >>
> >> Ok -- I have downloaded/extracted netboot.tar.gz and I use the following
> >> command:
> >>
> >> "qemu-system-x86_64" -drive file=debian.img,format=raw -m 8126 -accel
> >> hax   -machine q35 -boot n -device e1000,netdev=n1 -netdev
> >> user,id=n1,tftp=$PWD,bootfile=/pxelinux.0 -nographic
> >>
> >> I get the error "could not read the boot disk".
> >>
> >> Any thoughts on what I'm missing?
> > 
> > Both tcpdump and strace outputs? I know, I know ;)
> > 
> > This does not look right; "bootfile=/pxelinux.0".
> > You're assumed to have pxelinux binary, its libraries, pxelinux.cfg, etc
> > in the same directory, and to point QEMU there.
> > 
> 
> Taking care of the symlink I now get:
> 
>   [Link:up, TX:0 TXE:0 RX:0 RXE:0]
> Configuring (net0 52:54:00:12:34:56)..... ok
> net0: 10.0.2.15/255.255.255.0 gw 10.0.2.2
> Next server: 10.0.2.2
> Filename: /pxelinux.0
> tftp://10.0.2.2//pxelinux.0... ok
> pxelinux.0 : 80 bytes [PXE-NBP]
> 
> 
> Looks like the command is working, what I need to understand is how to
> configure Debian netbooting using pxe.
> So I guess my question is:
> 
> Other then netboot.gz (downloaded and extracted), what else do I need?

To follow this guide, for instance:

http://www.briancarpio.com/2012/04/04/system-automation-part-1/

There's no need to configure another TFTP server, QEMU takes care of it
already. But appropriate placing of syslinux binaries, configuration
files, etc - it's all there.

Reco

[toc] | [prev] | [next] | [standalone]


#202277

Fromjohn doe <johndoe65534@mail.com>
Date2018-11-09 07:20 +0100
Message-ID<wS8j8-5i0-3@gated-at.bofh.it>
In reply to#202226
On 11/7/2018 2:58 PM, Reco wrote:
> 	Hi.
> 
> On Wed, Nov 07, 2018 at 02:27:32PM +0100, john doe wrote:
>> On 11/7/2018 7:26 AM, Reco wrote:
>>> 	Hi.
>>>
>>> On Tue, Nov 06, 2018 at 08:44:08PM +0100, john doe wrote:
>>>> On 11/6/2018 5:05 PM, john doe wrote:
>>>>> On 11/6/2018 4:02 PM, Reco wrote:
>>>>>> 	Hi.
>>>>>>
>>>>>> On Tue, Nov 06, 2018 at 03:04:25PM +0100, john doe wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'm trying to install Debian Stretch using a preseeding file.
>>>>>>> All of this is with Qemu and  I'm not sure how  to pass the path of the
>>>>>>> preseed file:
>>>>>>>
>>>>>>> qemu-system-x86_64 -drive file=debian.img,format=raw -cdrom
>>>>>>> debian-9.5.0-amd64-netinst.iso -boot d -nographic -kernel vmlinuz
>>>>>>> -append "console=ttyS0,115200n8 auto=true priority=critical
>>>>>>> DEBIAN_FRONTEND=text preseed=preseed.cfg" -initrd initrd.gz
>>>>>>>
>>>>>>> The d-i can not find the preseed.cfg file, as anyone has any idea on how
>>>>>>> I can install Debian with a preseed file using qemu?
>>>>>>
>>>>>> Since you do not specify "-net", that means "-net user".
>>>>>> As [1] shows us, "-net user" comes with built-in TFTP server.
>>>>>>
>>>>>> So, you either replace your "-kernel", "-initrd" and "-append" with TFTP
>>>>>> invocation, and install Debian as if it was installed from TFTP.
>>>>>> Or rebuild d-i initrd to include your preseed.cfg.
>>>>>>
>>>>>
>>>>> Thank you, I didn't think to install debian using PXE with qemu acting
>>>>> as tftp server.
>>>>>
>>>>
>>>> Ok -- I have downloaded/extracted netboot.tar.gz and I use the following
>>>> command:
>>>>
>>>> "qemu-system-x86_64" -drive file=debian.img,format=raw -m 8126 -accel
>>>> hax   -machine q35 -boot n -device e1000,netdev=n1 -netdev
>>>> user,id=n1,tftp=$PWD,bootfile=/pxelinux.0 -nographic
>>>>
>>>> I get the error "could not read the boot disk".
>>>>
>>>> Any thoughts on what I'm missing?
>>>
>>> Both tcpdump and strace outputs? I know, I know ;)
>>>
>>> This does not look right; "bootfile=/pxelinux.0".
>>> You're assumed to have pxelinux binary, its libraries, pxelinux.cfg, etc
>>> in the same directory, and to point QEMU there.
>>>
>>
>> Taking care of the symlink I now get:
>>
>>   [Link:up, TX:0 TXE:0 RX:0 RXE:0]
>> Configuring (net0 52:54:00:12:34:56)..... ok
>> net0: 10.0.2.15/255.255.255.0 gw 10.0.2.2
>> Next server: 10.0.2.2
>> Filename: /pxelinux.0
>> tftp://10.0.2.2//pxelinux.0... ok
>> pxelinux.0 : 80 bytes [PXE-NBP]
>>
>>
>> Looks like the command is working, what I need to understand is how to
>> configure Debian netbooting using pxe.
>> So I guess my question is:
>>
>> Other then netboot.gz (downloaded and extracted), what else do I need?
> 
> To follow this guide, for instance:
> 
> http://www.briancarpio.com/2012/04/04/system-automation-part-1/
> 
> There's no need to configure another TFTP server, QEMU takes care of it
> already. But appropriate placing of syslinux binaries, configuration
> files, etc - it's all there.
> 

For the time being I use an http server running locally

If you have python handy:

$ python -m <[SimpleHTTPServer]>|<[http.server]>

Depending of the python version use one or the other module.
The idea is to fetch the preseed file from an http server running
locally or not.

So the command I ended up using is:

$ qemu-system-x86_64 -drive file=debian.img,format=raw -nographic
-serial telnet:localhost:5555,server -cdrom
debian-9.5.0-amd64-netinst.iso -kernel vmlinuz -append
"console=ttyS0,115200n8 DEBIAN_FRONTEND=text auto=true priority=critical
preseed/url=http://localhost:8000" -initrd initrd.gz

All of this is done on Windows, the telnet redirection is probably not
needed on linux! :)

Thanks to Reco for his help.

As an aside, with the above command on the installed system the output
of the terminal is not redirected through the serial console.
The below line needs to be manually edited in '/etc/default/grub' by
appending 'console=ttyS0,115200n8':

From:

GRUB_CMDLINE_LINUX=""

To:

GRUB_CMDLINE_LINUX="console=ttyS0,11520n8"


-- 
John Doe

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web