WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Appending boot codes from QEMU  (Read 4006 times)

Offline maddog

  • Newbie
  • *
  • Posts: 7
Appending boot codes from QEMU
« on: May 17, 2012, 06:27:30 PM »
I have looked high and low for a solution but am still unable to pass boot codes such as xvesa=800x600x16 from QEMU to tiny core.  I want to be able to detect the best resolution for a Windows host.

I am using the following on Windows XP:

qemu.exe -L .\bios\ -m 256 -localtime -soundhw es1370 -kernel boot/vmlinuz -initrd boot/tinycore.gz -hda mydrive.img -append "tc xvesa=800x600x16 quiet"

It is using the "quiet" command but it is ignoring the xvesa=...

Please help...


Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Appending boot codes from QEMU
« Reply #1 on: May 25, 2012, 09:43:08 PM »
This is a rather surprising report to me. In my case (using QEMU v0.11.1 with KQEMU) the 'xvesa=...' part works as expected.

Which version of QEMU are you using, and what does head -1 ~/.xsession or cat /proc/cmdline show?

May I suggest to take the hard disk (i.e. '-hda mydrive.img') out of the equation to eliminate any potential side effects. Furthermore you don't need the 'tc' part of your '-append' string as this is only used by the SYSLINUX boot loader to pick a stanza from its configuration.

Offline maddog

  • Newbie
  • *
  • Posts: 7
Re: Appending boot codes from QEMU
« Reply #2 on: June 11, 2013, 06:58:29 PM »
Thank you for the response.  I've been "out of the game" for a while and am only seeing your response now.

Removing the "-hda..." portion worked.  Is there a way that I can use the img file and pass boot codes in?

Thank you again for your help and I hope that this topic hasn't died.

Offline dtopham

  • Newbie
  • *
  • Posts: 17
Re: Appending boot codes from QEMU
« Reply #3 on: August 23, 2014, 07:38:51 PM »
I have looked high and low for a solution but am still unable to pass boot codes such as xvesa=800x600x16 from QEMU to tiny core.  I want to be able to detect the best resolution for a Windows host.

I am using the following on Windows XP:

qemu.exe -L .\bios\ -m 256 -localtime -soundhw es1370 -kernel boot/vmlinuz -initrd boot/tinycore.gz -hda mydrive.img -append "tc xvesa=800x600x16 quiet"

It is using the "quiet" command but it is ignoring the xvesa=...

Please help...

I am new to TinyCore and Linux and trying to deepen my understanding of the boot process. I noticed the above forum question which is related to my own confusion, so am quoting it for reference.    When I do this:

qemu -L . -cdrom TinyCore-current.iso -boot d

then tinycore boots fine to the desktop with X, but if I do this:

qemu -L .  -kernel boot/vmlinuz -initrd boot/core.gz

it only boots to a command line (i.e. X does not start)

Is this because booting from the CD is running other initializations?  or adding some bootcodes?

Actually my reason for trying the second option of booting in qemu is because I found that doing this:

qemu -L . -cdrom TinyCore-current.iso -boot d -append "quiet"

does not work at all (i.e. qemu fails to even start)

which makes me think that bootcodes cannot be added unless using the kernel and initrd method.

My real goal is to boot TinyCore using qemu but have the bootcodes I want automatically added rather than to be required to hit the "tab" key and add them each time (e.g. showapps opt=sda1 home=sda1 pause tce=sda1)

(I now I need to add the -hda hd.img to use those bootcodes, but left that out to simplify the question)


Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Appending boot codes from QEMU
« Reply #4 on: August 23, 2014, 11:15:05 PM »

Offline dtopham

  • Newbie
  • *
  • Posts: 17
Re: Appending boot codes from QEMU
« Reply #5 on: August 23, 2014, 11:28:46 PM »
I have read that book cover to cover several times, but it does not answer my question!  Perhaps because my knowledge of Linux is not yet strong enough to read between the lines?  If you point to the pages that explain how to use -append with qemu I would appreciate that very much.  Or is it my lack of knowledge of the boot scripts being invoked?  i.e. When I boot with only the kernel and initrd, am I missing something that normally happens when booting from live cd?

Offline dtopham

  • Newbie
  • *
  • Posts: 17
Re: Appending boot codes from QEMU
« Reply #6 on: August 23, 2014, 11:33:25 PM »
Thanks you...so that means there is some scripts that are run (that do that for me) if I boot from CD, but not if I boot directly from kernel+core?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Appending boot codes from QEMU
« Reply #7 on: August 23, 2014, 11:35:12 PM »
Install to the qemu virtual disk.
This is no different than any other disk install.

Offline dtopham

  • Newbie
  • *
  • Posts: 17
Re: Appending boot codes from QEMU
« Reply #8 on: August 23, 2014, 11:42:13 PM »
OK, I will go that route...somehow I got the impression that tc was not meant for traditional install to hard disk!

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Appending boot codes from QEMU
« Reply #9 on: August 23, 2014, 11:45:59 PM »
The CD images are for installation.
Core is toolkit, not a live CD for everyday use.
It really needs some kind of persistent storage.

Offline dtopham

  • Newbie
  • *
  • Posts: 17
Re: Appending boot codes from QEMU
« Reply #10 on: August 24, 2014, 12:01:41 AM »
Here is the quote that threw me off:
"Modes of Operation

The Modes of Operation mix up how Tiny Core Loads, Mounts, and Installs at boot time (see Philosophies, above, if you want to clarify what those three things mean here). Tiny Core has three main Modes:
Default Mode: Cloud/Internet
Mount Mode: TCZ/Install
Copy Mode: TCZ/Install + copy2fs.flg/lst

Again, some may say there is a "Traditional Mode: Install to Hard Drive", but that's not really a Mode at all. If you want to do it, go right ahead. It's just not one of the original goals of the project, so expect the normally slim documentation to be slimmer."

...from "concepts.html"

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Appending boot codes from QEMU
« Reply #11 on: August 24, 2014, 12:45:35 AM »
The modes have nothing to do with how it boots.
The mode describes how extensions are loaded

Offline dtopham

  • Newbie
  • *
  • Posts: 17
Re: Appending boot codes from QEMU
« Reply #12 on: August 24, 2014, 01:50:59 AM »
I see... "Install to Hard Drive"  means install applications, not install operating system!

but then, here on page 3  (Chapter 1, Core concepts) it says:

"Tiny Core is different because users are not encouraged to perform a traditional, hard-drive installation of the operating system."

I am not trying to be argumentative here, I am just trying to learn and understand the TinyCore concept. I think it is wonderful that we can experiment and try different options.  I now see that this meant to mean install it to a hard drive, but not in the usual way.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Appending boot codes from QEMU
« Reply #13 on: August 24, 2014, 04:31:32 AM »
You can't pass bootcodes with append when booting with -cdrom because the bootloader on the CD is used then. -append is only for Qemu's own bootloader, ie -kernel and -initrd as you found.

For X, it's because the CD includes the X extensions. Re install, yes we mean a frugal install usually, this is what our installer will do.
The only barriers that can stop you are the ones you create yourself.