Skip to content
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

Doesn't work on Ubuntu 16.04/xenial #14

Closed
mskonovalov opened this issue Mar 20, 2017 · 21 comments
Closed

Doesn't work on Ubuntu 16.04/xenial #14

mskonovalov opened this issue Mar 20, 2017 · 21 comments

Comments

@mskonovalov
Copy link

Thank you for your tool, but unfortunately it doesn't work for me

user@host:~$ grub2-theme-preview --grub2-mkrescue grub-mkrescue --verbose /boot/grub/themes/Fallout/
INFO: Appending to fonts to load: fixedsys-regular-24.pf2
INFO: Appending to fonts to load: fixedsys-regular-32.pf2
# grub-mkrescue --xorriso xorriso --output /tmp/tmphfYhW9/grub2_theme_demo.img boot/grub/grub.cfg=/tmp/tmphfYhW9/grub.cfg boot/grub/themes/DEMO/=/boot/grub/themes/Fallout
xorriso 1.4.2 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:/tmp/tmphfYhW9/grub2_theme_demo.img'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 7532m free
Added to ISO image: directory '/'='/tmp/grub.rsdceU'
xorriso : UPDATE : 278 files added in 1 seconds
Added to ISO image: file '/boot/grub/grub.cfg'='/tmp/tmphfYhW9/grub.cfg'
Added to ISO image: directory '/boot/grub/themes/DEMO'='/boot/grub/themes/Fallout'
xorriso : UPDATE : 324 files added in 1 seconds
ISO image produced: 5213 sectors
Written to medium : 5213 sectors at LBA 0
Writing to 'stdio:/tmp/tmphfYhW9/grub2_theme_demo.img' completed successfully.

INFO: Please give GRUB a moment to show up in QEMU...
# qemu-system-x86_64 -drive file=/tmp/tmphfYhW9/grub2_theme_demo.img,index=0,media=disk,format=raw
warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]

And unfortunately all I can see is
image

And if I create img for QEMU by hands (converting img from vmdk) everything works.

I can attach generated *.img file if needed.

@hartwork
Copy link
Owner

hartwork commented Mar 20, 2017

Hi!

My guess is that the TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5] up there is at fault: QEMU does not seem to fully work in TCG mode (which is the default) in your environment. I Googled a bit for that message but no real clue on why it would fail, yet. What environment are you running this in: what architecture, host/chroot/container/VM(if so which type), ...?

My guess would be that you are running Ubuntu in a virtual machine that does not have nested VMX enabled.

Else and if you have KVM around, please give this patch a try:

diff --git a/grub2_theme_preview/cli.py b/grub2_theme_preview/cli.py
index f57c79c..bfe41ce 100644
--- a/grub2_theme_preview/cli.py
+++ b/grub2_theme_preview/cli.py
@@ -287,6 +287,7 @@ def _inner_main(options):
 
                 run_command = [
                     options.qemu,
+                    '-machine', 'pc,accel=kvm:tcg',
                     '-drive', 'file=%s,index=0,media=disk,format=raw' % abs_tmp_img_file,
                     ]
                 _run(run_command, options.verbose)

Best, Sebastian

@hartwork
Copy link
Owner

hartwork commented Mar 20, 2017

PS: If that Fallout theme happens to be public, please share a link. I'd be curious and I didn't find it using Google...

@mskonovalov
Copy link
Author

Hi, thank you for reply.
I use Ubuntu 16.04 on my HP laptop.
I'll verify your suggestions a bit later.

P.S. https://github.com/mskonovalov/grub2-theme-fallout

@regalstreak
Copy link

regalstreak commented Mar 29, 2017

warning: host doesn't support requested feature: CPUID.80000001H:ECX.svm

Getting this :/ (After the patch)

@hartwork
Copy link
Owner

With that patch mentioned above or without?
What environment are you running this in: what architecture, host/chroot/container/VM(if so which type), ...?
Are you able to boot other things with KVM/QEMU, say an Ubuntu live CD, or is it just grub2-theme-preview?

Best, Sebastian

@regalstreak
Copy link

I don't have an idea about QEMU currently. This is really my first time at tinkering around with it.
After the patch, yeah.
Running it on host: Intel(R) Core(TM) i7-4510U CPU x64 (dunno much about virtualisation too, first time!)

I'll try running something else. Didn't do it till now.


BTW I did this:

diff --git a/grub2_theme_preview/cli.py b/grub2_theme_preview/cli.py
index f57c79c..fde1c09 100644
--- a/grub2_theme_preview/cli.py
+++ b/grub2_theme_preview/cli.py
@@ -287,6 +287,8 @@ def _inner_main(options):
 
                 run_command = [
                     options.qemu,
+                    '-machine', 'pc,accel=kvm:tcg',
+                    '-cpu', 'host',
                     '-drive', 'file=%s,index=0,media=disk,format=raw' % abs_tmp_img_file,
                     ]
                 _run(run_command, options.verbose)

And it's still stuck there (with no warnings and stuff)

regalstreak@rsubuntu:~/Development/Grub2/Themes/Testing/grub2-theme-preview$ ./grub2-theme-preview --grub2-mkrescue grub-mkrescue --verbose ../Grub2-themes/Archxion/
INFO: Appending to fonts to load: Sans-10.pf2
INFO: Appending to fonts to load: Sans-12.pf2
INFO: Appending to fonts to load: Sans-14.pf2
# grub-mkrescue --xorriso xorriso --output /tmp/tmphn4fFn/grub2_theme_demo.img boot/grub/grub.cfg=/tmp/tmphn4fFn/grub.cfg boot/grub/themes/DEMO/=/home/regalstreak/Development/Grub2/Themes/Testing/Grub2-themes/Archxion
xorriso 1.4.4 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:/tmp/tmphn4fFn/grub2_theme_demo.img'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data,  179g free
Added to ISO image: directory '/'='/tmp/grub.zQRFcs'
xorriso : UPDATE : 278 files added in 1 seconds
Added to ISO image: file '/boot/grub/grub.cfg'='/tmp/tmphn4fFn/grub.cfg'
Added to ISO image: directory '/boot/grub/themes/DEMO'='/home/regalstreak/Development/Grub2/Themes/Testing/Grub2-themes/Archxion'
xorriso : UPDATE : 334 files added in 1 seconds
ISO image produced: 4685 sectors
Written to medium : 4685 sectors at LBA 0
Writing to 'stdio:/tmp/tmphn4fFn/grub2_theme_demo.img' completed successfully.

INFO: Please give GRUB a moment to show up in QEMU...
# qemu-system-x86_64 -machine pc,accel=kvm:tcg -cpu host -drive file=/tmp/tmphn4fFn/grub2_theme_demo.img,index=0,media=disk,format=raw

@regalstreak
Copy link

regalstreak commented Mar 29, 2017

Can run Ubuntu 16.04 with QEMU. So maybe this is a grub2-theme-preview issue.

This works good:

regalstreak@rsubuntu:~/Development/QEMU/ubuntu$ ls
ubuntu-16.04-desktop-amd64.iso  ubuntu.img

regalstreak@rsubuntu:~/Development/QEMU/ubuntu$ qemu-system-x86_64 -hda ubuntu.img -boot d -cdrom ./ubuntu-16.04-desktop-amd64.iso -m 2048
WARNING: Image format was not specified for 'ubuntu.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
main-loop: WARNING: I/O thread spun for 1000 iterations

EDIT:
Actually man, if this is not an active project, it's alright. I can reboot to test the theme or i'll just look at your blog and make that manually lol. Don't tire yourself up on it! :D

@hartwork
Copy link
Owner

hartwork commented Mar 29, 2017

Sot it boots fine despite warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5] in the output in your case?

@hartwork
Copy link
Owner

hartwork commented Mar 29, 2017

Does

grub-mkrescue --output boot.iso
qemu-system-x86_64 -cdrom boot.iso

show an interactive grub prompt grub> with a bit of text above in QEMU?

@hartwork
Copy link
Owner

hartwork commented Apr 2, 2017

@regalstreak any news?

@regalstreak
Copy link

@hartwork i have university entrance exams coming up so I haven't looked. I'll try on 13th and revert. 👍

@hartwork
Copy link
Owner

hartwork commented Apr 5, 2017

Good luck, see you later. Thanks for the update!

@hartwork
Copy link
Owner

hartwork commented May 1, 2017

@regalstreak any news?

@mskonovalov
Copy link
Author

I've tried on Ubuntu 14.04 and have another problem

image

user@pc:~/grub2-theme-preview$ grub2-theme-preview ~/grub2-theme-fallout/theme/ --grub2-
mkrescue grub-mkrescue --verbose
INFO: Appending to fonts to load: fixedsys-regular-32.pf2
# grub-mkrescue --xorriso xorriso --output /tmp/tmp4bS0OO/grub2_theme_demo.img boot/grub/grub.cfg=/tmp/tmp4bS0OO/grub.cfg boot/grub/themes/DEMO/=/home/kms/grub2-theme-fallout/theme
xorriso 1.3.2 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:/tmp/tmp4bS0OO/grub2_theme_demo.img'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 34.0g free
Added to ISO image: directory '/'='/tmp/grub.qhutn7'
xorriso : UPDATE : 280 files added in 1 seconds
Added to ISO image: file '/boot/grub/grub.cfg'='/tmp/tmp4bS0OO/grub.cfg'
Added to ISO image: directory '/boot/grub/themes/DEMO'='/home/kms/grub2-theme-fallout/theme'
xorriso : UPDATE : 349 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 512 bytes from file '/usr/lib/grub/i386-pc/boot_hybrid.img'
ISO image produced: 3422 sectors
Written to medium : 3422 sectors at LBA 0
Writing to 'stdio:/tmp/tmp4bS0OO/grub2_theme_demo.img' completed successfully.

INFO: Please give GRUB a moment to show up in QEMU...
# qemu-system-x86_64 -drive file=/tmp/tmp4bS0OO/grub2_theme_demo.img,index=0,media=disk,format=raw

@hartwork
Copy link
Owner

hartwork commented May 2, 2017

Could you try if

grub-mkrescue --output boot.iso
qemu-system-x86_64 -cdrom boot.iso

shows an interactive grub prompt grub> with a bit of text above in QEMU? Thanks!

@mskonovalov
Copy link
Author

Yes, it works

@mskonovalov
Copy link
Author

Maybe I could share img file that is created?

@GendelfLugansk
Copy link

Hello
I'm on Ubuntu 17.10 and grub2-theme-preview does not work for me. No errors

screenshot

@hartwork
Copy link
Owner

hartwork commented Dec 20, 2017

I hope to find some time for working on this issue again before January.

@regalstreak
Copy link

I got over it and am using the drab black normal theme on grub2 since may

@hartwork hartwork changed the title Doesn't work on Ubuntu 16.04 Doesn't work on Ubuntu 16.04/xenial Dec 27, 2017
hartwork added a commit that referenced this issue Dec 29, 2017
to help debugging issues like #14.
hartwork added a commit that referenced this issue Dec 29, 2017
Without i386-pc available, the resulting rescue image
could cause error "Could not read from CDROM (code 0004)"
during boot in QEMU.  Related to issue #14.
@hartwork
Copy link
Owner

I played with (a pristine chroot of) Ubuntu 16.04 myself now. Without package grub-pc-bin installed, QEMU failed to boot the rescue image saying Could not read from CDROM (code 0004). After sudo apt-get install grub-pc-bin it booted fine. So I enforce use of platform i386-pc in the code now and produce an error if it's found missing.

I consider this ticket fixed. If you still run into issues, please make new tickets (with terminal output, Ubuntu version, and a screenshot of te QEMU window). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants