New issue
Advanced search Search tips

Issue 632303 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Aug 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature



Sign in to add a comment

Detect when Chrome OS is running in a VM

Project Member Reported by norvez@chromium.org, Jul 28 2016

Issue description

Some features (e.g. HWID) aren't available in VMs and Chrome OS components (crossystem, Chrome) handle that -or don't!- in a ad hoc manner that may or may not work on various architectures, VM environments, etc. For example see  crbug.com/585514 ,  crbug.com/585515 /, b/30155895.
We should make all this more consistent and robust.
 

Comment 1 by norvez@chromium.org, Aug 10 2016

Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 10 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/969ce32e407f32671ab79444238b9ddf98c7d960

commit 969ce32e407f32671ab79444238b9ddf98c7d960
Author: Nicolas Norvez <norvez@chromium.org>
Date: Tue Aug 09 10:42:08 2016

Detect and report VM environment in crossystem

Add "inside_vm" command to crossystem.
x86: If there is no HWID and mainfw_type is "nonchrome", report that the
host is a VM. If HWID is present, it's not a VM.
ARM: Detection not implemented and so far no ARM VMs exist, always
report that the system is not a VM

BUG= chromium:632303 
TEST=emerge-cyan vboot_reference and test binary on cyan QEMU and HW
BRANCH=none

Change-Id: I18f5cb24b68e51f3097d9aafd9f0db0e610d322a
Reviewed-on: https://chromium-review.googlesource.com/367240
Commit-Ready: Nicolas Norvez <norvez@chromium.org>
Tested-by: Nicolas Norvez <norvez@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>

[modify] https://crrev.com/969ce32e407f32671ab79444238b9ddf98c7d960/host/arch/arm/lib/crossystem_arch.c
[modify] https://crrev.com/969ce32e407f32671ab79444238b9ddf98c7d960/host/arch/x86/lib/crossystem_arch.c
[modify] https://crrev.com/969ce32e407f32671ab79444238b9ddf98c7d960/host/arch/mips/lib/crossystem_arch.c
[modify] https://crrev.com/969ce32e407f32671ab79444238b9ddf98c7d960/utility/crossystem.c

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/8e917140b7ffafebb82d32998e9f56ad215a53c6

commit 8e917140b7ffafebb82d32998e9f56ad215a53c6
Author: Nicolas Norvez <norvez@chromium.org>
Date: Fri Aug 12 11:32:42 2016

crossystem: refactor VM detection to share across architectures

If there is no HWID and mainfw_type is "nonchrome", report that the
host is a VM. If HWID is present, it's not a VM. Make the detection
architecture-independent.

BUG= chromium:632303 
TEST=emerge-cyan vboot_reference and test binary on QEMU and HW
TEST=emerge-veyron_minnie vboot_reference and test binary on HW
BRANCH=none

Change-Id: I076eb9838a3b724ded0cfded9fb8d8a5392631c8
Reviewed-on: https://chromium-review.googlesource.com/368650
Commit-Ready: Nicolas Norvez <norvez@chromium.org>
Tested-by: Nicolas Norvez <norvez@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>

[modify] https://crrev.com/8e917140b7ffafebb82d32998e9f56ad215a53c6/host/arch/arm/lib/crossystem_arch.c
[modify] https://crrev.com/8e917140b7ffafebb82d32998e9f56ad215a53c6/host/arch/x86/lib/crossystem_arch.c
[modify] https://crrev.com/8e917140b7ffafebb82d32998e9f56ad215a53c6/host/lib/crossystem.c
[modify] https://crrev.com/8e917140b7ffafebb82d32998e9f56ad215a53c6/host/arch/mips/lib/crossystem_arch.c

Project Member

Comment 4 by bugdroid1@chromium.org, Aug 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b923b70a31b4fb3eb286f6a5e4482b844afa4a40

commit b923b70a31b4fb3eb286f6a5e4482b844afa4a40
Author: norvez <norvez@chromium.org>
Date: Fri Aug 19 10:07:28 2016

Gracefully handle cases where Chrome OS is running in a VM

Read from crossystem whether Chrome OS is running inside a VM or not. Do
not report an error if Chrome OS is in a VM, even if the HWID is
invalid, it is expected.
Add IsRunningOnVm() method similar to IsRunningOnChromeOS().
Cleanup:
	- more consistent naming
	- add unit tests to hwid_checker

BUG= chromium:632303 
BUG= chromium:585514 
TEST=Ran by hand on cyan board and cyan image in QEMU

Review-Url: https://codereview.chromium.org/2218703006
Cr-Commit-Position: refs/heads/master@{#413097}

[modify] https://crrev.com/b923b70a31b4fb3eb286f6a5e4482b844afa4a40/chrome/browser/chromeos/login/hwid_checker.cc
[modify] https://crrev.com/b923b70a31b4fb3eb286f6a5e4482b844afa4a40/chrome/browser/chromeos/login/hwid_checker_unittest.cc
[modify] https://crrev.com/b923b70a31b4fb3eb286f6a5e4482b844afa4a40/chromeos/system/fake_statistics_provider.cc
[modify] https://crrev.com/b923b70a31b4fb3eb286f6a5e4482b844afa4a40/chromeos/system/fake_statistics_provider.h
[modify] https://crrev.com/b923b70a31b4fb3eb286f6a5e4482b844afa4a40/chromeos/system/statistics_provider.cc
[modify] https://crrev.com/b923b70a31b4fb3eb286f6a5e4482b844afa4a40/chromeos/system/statistics_provider.h

Comment 5 by norvez@chromium.org, Aug 19 2016

Status: Fixed (was: Started)
Labels: VerifyIn-54

Comment 7 by ka...@chromium.org, Sep 2 2016

Labels: Bulk-Verified
Status: Verified (was: Fixed)

Sign in to add a comment