Bug 1971 - Enhance BA to run in VirtualBox
Summary: Enhance BA to run in VirtualBox
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Build System, Metadata & Runtime
Component: build-appliance (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 1.9 M1
Assignee: Juro Bystricky
QA Contact: Cristina Agurida
URL:
Whiteboard: 02 April 2014: Some web page adjustme...
: 3017 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-09 08:43 UTC by Scott Garman
Modified: 2015-09-10 07:15 UTC (History)
11 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments
Build Appliance Image Configuration (67.53 KB, image/png)
2014-03-04 13:23 UTC, Cristian Iorga
no flags Details
Build Appliance: build in progress (71.72 KB, image/png)
2014-03-04 13:24 UTC, Cristian Iorga
no flags Details
Build Appliance Image Details (build complete) (75.21 KB, image/png)
2014-03-04 13:24 UTC, Cristian Iorga
no flags Details
Build Appliance under vmWare Player: technical details (156.90 KB, image/png)
2014-03-04 13:25 UTC, Cristian Iorga
no flags Details
Build Appliance under Oracle VirtualBox: technical details (72.75 KB, image/png)
2014-03-04 13:26 UTC, Cristian Iorga
no flags Details
BA VirtualBox machine OS settings (84.70 KB, image/png)
2014-03-31 08:29 UTC, Cristian Iorga
no flags Details
BA VirtualBox CPU settings (52.36 KB, image/png)
2014-03-31 08:29 UTC, Cristian Iorga
no flags Details
BA VirtualBox memory settings (76.06 KB, image/png)
2014-03-31 08:30 UTC, Cristian Iorga
no flags Details
BA VirtualBox disk settings (51.54 KB, image/png)
2014-03-31 08:31 UTC, Cristian Iorga
no flags Details
BA VirtualBox running under VirtualBox (191.26 KB, image/png)
2014-03-31 08:34 UTC, Cristian Iorga
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Garman 2012-02-09 08:43:10 UTC
This thread describes a possible bug in the way we enable openGL support on Ubuntu 11.10 systems:

https://lists.yoctoproject.org/pipermail/yocto/2012-February/006965.html

If this cannot be reproduced, it may need to be tested within a VirtualBox VM.
Comment 1 Saul Wold 2012-04-20 00:33:24 UTC
This could be an issue with either OpenGL or qemu or a bug in Virtualbox handling, needs more identification
Comment 2 Cristian Iorga 2012-11-28 10:40:08 UTC
Hello,

In my opinion, this is a rather unusual way to run YP/Poky/Yocto Linux.
As such, can this bug priority be lowered?

Also, I ran the following configuration and it worked correctly:

Ubuntu Linux 12.10 64 bits -> VMware Player -> Build Appliance -> QEMU -> Yocto Linux.

I will investigate further on this one.
Comment 3 Saul Wold 2013-04-24 15:24:30 UTC
*** Bug 3017 has been marked as a duplicate of this bug. ***
Comment 4 Cristian Iorga 2014-01-09 12:32:04 UTC
Milestone pushed back due to priorities change.
Comment 5 Cristian Iorga 2014-02-28 08:15:42 UTC
Work resumed.
Comment 6 Cristian Iorga 2014-02-28 08:24:54 UTC
The objective of this enhancement is to add support for Build Appliance so that it can be run under Oracle VirtualBox, thus extending the number of platforms under which Build Appliance can be run (Linux, Windows, MacOS X).
Comment 7 Cristian Iorga 2014-03-03 18:15:02 UTC
If Build Appliance is built for genericx86-64 machine, the vmdk image can be booted correctly using Oracle VirtualBox.
Comment 8 Cristian Iorga 2014-03-04 13:19:15 UTC
The new recommended machine for Build Appliance is genericx86-64. In this way, Build Appliance vmdk-based image can be started and run under both VmWare Player (Windows/Linux) and Oracle VirtualBox (Windows/Linux/MacOSX).
X11-based graphics works correctly, and proper graphics drivers are loaded in each case.
Under both virtualizers Build Appliance worked without any errors, building and running under qemu a core-image-minimal qemux86-64 machine.
Detailed instructions for running under each virtualization solution will be added to YP documentation.
Comment 9 Cristian Iorga 2014-03-04 13:23:15 UTC
Created attachment 1792 [details]
Build Appliance Image Configuration
Comment 10 Cristian Iorga 2014-03-04 13:24:07 UTC
Created attachment 1793 [details]
Build Appliance: build in progress
Comment 11 Cristian Iorga 2014-03-04 13:24:42 UTC
Created attachment 1794 [details]
Build Appliance Image Details (build complete)
Comment 12 Cristian Iorga 2014-03-04 13:25:27 UTC
Created attachment 1795 [details]
Build Appliance under vmWare Player: technical details
Comment 13 Cristian Iorga 2014-03-04 13:26:09 UTC
Created attachment 1796 [details]
Build Appliance under Oracle VirtualBox: technical details
Comment 14 Cristian Iorga 2014-03-05 09:04:34 UTC
There is a known issue that prevents running Build Appliance (and other Linux distributions) under the latest Oracle VirtualBoxm, namely v4.3.8.
Reference: https://www.virtualbox.org/ticket/12748
Issue has been fixed, but a new version of VirtualBox has not been released yet with the fix integrated.
Build Appliance is working correctly under VirtualBox v4.2.22.
Comment 15 Saul Wold 2014-03-06 15:54:33 UTC
Some additional documentation notes are needed in the appropriate places in the Build appliance docs.

Scott - can you handle this.
Comment 16 Scott Rifenbark 2014-03-07 21:31:21 UTC
Saul, 

The documentation for the Build Appliance is on the YP website at https://www.yoctoproject.org/documentation/build-appliance-manual.  So any specific instructions would have to be entered there.  I typically do not update these as I don't have the ability to edit the website.  I could provide final text though for someone (likely Jeff) to actually update the website with.

Scott
Comment 17 Cristian Iorga 2014-03-09 18:46:10 UTC
Hi Scott,

Please let me know if I can help you on this documentation task.

Regards,
Cristian
Comment 18 Scott Rifenbark 2014-03-25 18:16:24 UTC
Hi Cristian, 

I got permission to edit the website and am checking it out.  (https://www.yoctoproject.org/documentation/build-appliance-manual.)  I actually updated the first three bullets of the procedure there already as an aside because the steps assumed the old web-site design.

Regarding the changes I need for this bug, you are saying that the Build Appliance cannot run under the latest Oracle VirtualBoxm, namely v4.3.8, because it has not yet been released.  And, that it can run under VirtualBox v4.2.22.

I don't know where in the steps a user would make sure this version of VirtualBox would be being used.  There is nothing in the current steps indicating VirtualBox versions.  

Is the correct version of VirtualBox part of the zip file I am downloading?  Maybe it would be step 6, which says "Follow the instructions from the VMware site for installing either MMware Player or VMware Workstation."?  I am not sure.  

Can you advise on exactly what I need to tell the user here?

Thanks, 
Scott
Comment 19 Cristian Iorga 2014-03-27 13:22:39 UTC
Hello Scott, the info related to Oracle VirtualBox version is no longer needed, as in the meantime a new version of VirtualBox was released, which solves the issue signaled by me in v4.3.8.
Comment 20 Cristian Iorga 2014-03-27 13:24:39 UTC
Issue that prevented running BA under current (at that point) VirtualBox has been fixed and included in the latest release of VirtualBox:
Reference: https://www.virtualbox.org/ticket/12748
Comment 21 Cristian Iorga 2014-03-27 13:45:59 UTC
Hello Scott,

Basically, the information that needs to be added regarding running BA under VirtualBox is:

1. While building Build Appliance, the machine needs to be set to genericx86-64.
So MACHINE=genericx86-64 should be set.

2. What will be used at the end of the build will be Yocto_Build_Appliance.vmdk file
3. The user of BA will create a new virtual machine in VirtualBox (using the included wizard) and will used the Yocto_Build_Appliance.vmdk file as a existing virtual disk for the newly created virtual machine (User will select the image in the wizard, it is straightforward).
4. After that, user can start BA in VirtualBox normally.

Regards,
Cristian
Comment 22 Scott Rifenbark 2014-03-28 20:07:06 UTC
Cristian, 

I installed VirtualBox and went through the wizard to create a new virtual machine.  When prompted about the disk, I specified to use an existing disk and the .vmdk file I had extracted out the downloaded ZIP file you gave me was made available.  

When I attempted to start my virtual machine, I got the following error message:

"SYSLINUX 6.01 EDD 2013-07-04 Copyright (C) 1994-2013 H. Peter Anvin et al
This kernel requires an x86-64 CPU, but only detected an i686 CPU.
Unable to boot - please use a kernel appropriate for your CPU."

My Windows laptop is running Windows 7 Enterprise with Service Pack 1.  It has an i5-3320M CPU.  The operating system is a 64-bit operating system.

Regarding the BA documentation page, I have an "in progress" version at https://www.yoctoproject.org/documentation/build-appliance-manual.  I placed a note at the top saying that the VirtualBox stuff was under construction in case anyone goes there and thinks that it is working.  I won't be able to get the steps right for the VirtualBox section until I can boot up and run this.  

Contact me when you can. 

Scott
Comment 23 Cristian Iorga 2014-03-31 08:29:25 UTC
Created attachment 1869 [details]
BA VirtualBox machine OS settings
Comment 24 Cristian Iorga 2014-03-31 08:29:54 UTC
Created attachment 1870 [details]
BA VirtualBox CPU settings
Comment 25 Cristian Iorga 2014-03-31 08:30:36 UTC
Created attachment 1871 [details]
BA VirtualBox memory settings
Comment 26 Cristian Iorga 2014-03-31 08:31:04 UTC
Created attachment 1872 [details]
BA VirtualBox disk settings
Comment 27 Cristian Iorga 2014-03-31 08:34:24 UTC
Created attachment 1873 [details]
BA VirtualBox running under VirtualBox
Comment 28 Cristian Iorga 2014-03-31 08:40:09 UTC
Hi Scott,

For my test I have used Oracle VirtualBox v4.3.10.

The error that you have is because the virtual machine CPU and OS is not set correctly.
Please observe BA VirtualBox machine OS settings attachment (BA-vbox-cpu-settings.png), in your case, the Linux is not set to be on 64bits. And BA is built to be used as x86 64 bits virtual machine.

Please notice the other attachments, as I have documented the rest of the recommended settings for CPU, memory, and disk image (the name does not matter for the disk).

Regards,
Cristian
Comment 29 Cristian Iorga 2014-03-31 08:51:04 UTC
Hi Scott,
This section of the site needs to be changed:
https://wiki.yoctoproject.org/wiki/How_do_I#Q:_How_do_I_build_the_build_appliance.3F

"Update the MACHINE variable to "qemux86-64" or "qemux86"" should be changed to:

"Update the MACHINE variable to "genericx86-64""

Regards,
Cristian
Comment 30 Scott Rifenbark 2014-03-31 14:20:04 UTC
Cristian, 

I don't have any 64-bit Linux choices available from the "Create Virtual Machine" dialog.  When I select "Linux" for Type, I have a long list of Versions available none of which offer any 64-bit distributions. 

The VirtualBox I downloaded and installed was also 4.3.10 for Windows Hosts with the link I clicked on for the download showing "x86/amd64".  I got the virtualizer from https://www.virtualbox.org/wiki/Downloads.

So I basically am stuck at the very first configuration dialog for VB.

Thanks, 
Scott
Comment 31 Cristian Iorga 2014-03-31 18:39:08 UTC
Hi Scott,

My only guess at this point is that VT-x processor feature is not enabled in BIOS in case of your laptop. In such a case, virtualization of x86-64 hosts is not not possible.
Can you check your laptop's BIOS for a setting related to virtualization or VT-x?

Regards,
Cristian
Comment 32 Scott Rifenbark 2014-04-02 11:34:04 UTC
Hi, 

Putting the doc changes to the web page on hold for 1.6.  Note that I did correct some wrong information on the https://www.yoctoproject.org/documentation/build-appliance-manual web page regarding how to navigate the YP site to get the ZIP file.  The information was old and had not been adjusted for the newer design of the YP site.

Scott
Comment 33 Juro Bystricky 2015-02-06 18:30:03 UTC
I just reguilt BA from scratch. Both build-appliance-image-qemux86.vmdk and build-appliance-image-qemux86-64.vmdk boot fine in VirtualBox (4.3.20).
The important thing is NOT to boot from IDE disk controller but use SATA
instead. (Otherwise the kernel panics).
Comment 34 Saul Wold 2015-02-12 19:52:33 UTC
Assigning to Juro, please review this thread: 
https://lists.yoctoproject.org/pipermail/yocto/2012-February/004756.html (which 
has moved from the original one listed in the description)
Comment 35 Juro Bystricky 2015-03-26 16:10:55 UTC
Some notes on possible improvements:
BA package contains Yocto_Build_Appliance.vmdk, Yocto_Build_Appliance.vmx and Yocto_Build_Appliance.vmxf files. The *.vmx, *.vmxf are meant for vmplayer only, VirtualBox only uses Yocto_Build_Appliance.vmdk. Therefore some initial VirtualBox setup overhead is required to get the BA up & running. This could be prone to errors, as VirtualBox default HD interface is IDE but BA needs a SATA.
This initial setup could be avoided by creating/distributing BA in OVA/OVF format. VirtualBox understands the format natively, however vmplayer does not (you need to run a utility/conversion program first).
VirtualBox also supports .VDI file format, this allows for "sparse" disks, which can dynamically grow and dynamically shrink as well. Unfortunatelly, OVA/OVF format does not support .VDI files.
It is possible to install VirtualBox guest additions as well. This would be quite desirable in order to support resizable windows. BA user HOB, but when the BA box is resized, HOB size stays the same, centered in the resized image. I believe this is due to matchbox window manager (by design).
Both vmplayer and VirtualBox may need to install guest additions. (There are some bug reports about wrong time stamps that need guest additions in order for the timer to be synchronized correctly). The process of installing of guest additions for vmplayer and VirtualBox is quite different.

So the cleanest way to "Enhance BA to run in VirtualBox" would probably be a separate BA package for VirtualBox.

This package would:
1. Be in OVA/OVF format
2. Allow installing guest additions (contains kernel headers, needs some documantation)
3. Contain resizable X11 windows manager.

Any thoughts?
Comment 36 Juro Bystricky 2015-07-28 17:56:26 UTC
Since it is already possible to run Build Appliance VM using reasonably current versions of Virtual Box, this bug can be considered resolved.

However, there is plenty of room for various immediate improvements, each addressed in a separate bug report:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=8072
https://bugzilla.yoctoproject.org/show_bug.cgi?id=8073
https://bugzilla.yoctoproject.org/show_bug.cgi?id=8074
Comment 37 Paul Eggleton 2015-07-28 18:12:18 UTC
OK great, but let's mark this as fixed since it did actually get implemented.