• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright 2021 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6qemu_args=(
7    -smp 8 -m 4G
8    -serial stdio -display none
9    -device virtio-net-pci,netdev=net0
10    -netdev user,id=net0,hostfwd=tcp::8022-:22
11    -hda rootfs.qcow2
12)
13
14# The build environment for first_boot.expect does not support KVM.
15if [ -e /dev/kvm ]; then
16    qemu_args+=(-enable-kvm -cpu host)
17fi
18mkdir -p /workspace/scratch/logs
19qemu-system-x86_64 ${qemu_args[@]} $@ | tee /workspace/logs/vm.log
20