How to launch Termina VM directly through crosvm from the host's terminal?

1,848 views
Skip to first unread message

Carlos Santa

unread,
Jul 19, 2021, 6:03:05 PM7/19/21
to Chromium OS Development
Hi:

Is it possible to launch Termina VM directly through crosvm from the host's terminal?, what would the command look like? 

This is the command I am using:

crosvm run -r /run/imageloader/termina-dlc/package/root/vm_rootfs.img -c 4 -m 1024 -s /run --cid 5 --host_ip 100.115.92.25 --netmask 255.255.255.252 --mac d2:47:f7:c5:9e:53 /run/imageloader/termina-dlc/package/root/vm_kernel

However, I am unable to get to the shell as maitred fails to notify to the system that the VM is up:

[    0.775775] maitred: Failed to notify host system that VM is ready: Socket closed

Below is the entire dmesg from the VM:

Regards,
CS

localhost ~ # crosvm run -r /run/imageloader/termina-dlc/package/root/vm_rootfs.img -c 4 -m 1024 -s /run --cid 5 --host_ip 100.115.92.25 --netmask 255.255.255.252 --mac d2:47:f7:c5:9e:53 /run/imageloader/termina-dlc/package/root/vm_kernel
[INFO:src/linux.rs:2532] crosvm entering multiprocess mode...
[    0.000000] Linux version 5.4.130-15918-ga06bae85e7dc (chrome-bot@chromeos-ci-legacy-us-east1-d-x32-122-9oke) (Chromium OS 12.0_pre422132_p20210405-r9 clang version 13.0.0 (/var/tmp/portage/sys-devel/llvm-12.0_pre422132_p20210405-r9/work/llvm-12.0_pre422132_p20210405/clang cd442157cff4aad209ae532cbf031abbe10bc1df)) #1 SMP PREEMPT Mon Jul 12 01:52:59 PDT 2021
[    0.000000] Command line: reboot=k panic=-1 pci=noacpi console=ttyS0 root=/dev/vda ro
[    0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x020: 'AVX-512 opmask'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x040: 'AVX-512 Hi256'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x080: 'AVX-512 ZMM_Hi256'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x200: 'Protection Keys User registers'
[    0.000000] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
[    0.000000] x86/fpu: xstate_offset[5]:  832, xstate_sizes[5]:   64
[    0.000000] x86/fpu: xstate_offset[6]:  896, xstate_sizes[6]:  512
[    0.000000] x86/fpu: xstate_offset[7]: 1408, xstate_sizes[7]: 1024
[    0.000000] x86/fpu: xstate_offset[9]: 2432, xstate_sizes[9]:    8
[    0.000000] x86/fpu: Enabled xstate features 0x2e7, context size is 2440 bytes, using 'compacted' format.
[    0.000000] BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[    0.000000] BIOS-e820: [mem 0x0000000000200000-0x000000003fffffff] usable
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] SMBIOS 3.2.0 present.
[    0.000000] DMI: ChromiumOS crosvm, BIOS 0
[    0.000000] Hypervisor detected: KVM
[    0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00
[    0.000002] kvm-clock: cpu 0, msr 156ff001, primary cpu clock
[    0.000002] kvm-clock: using sched offset of 218075841 cycles
[    0.000010] clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
[    0.000018] tsc: Initial usec timer 88485
[    0.000019] tsc: Detected 2995.200 MHz processor
[    0.000167] last_pfn = 0x40000 max_arch_pfn = 0x400000000
[    0.000217] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WP  UC- WT  
[    0.000256] found SMP MP-table at [mem 0x0009fc00-0x0009fc0f]
[    0.000326] check: Scanning 1 areas for low memory corruption
[    0.000469] Using GB pages for direct mapping
[    0.000522] ACPI: Early table checksum verification disabled
[    0.000535] ACPI: RSDP 0x00000000000E0000 000024 (v02 CROSVM)
[    0.000538] ACPI: XSDT 0x00000000000E0280 000034 (v01 CROSVM CROSVMDT 00000001 CROS 00000000)
[    0.000543] ACPI: FACP 0x00000000000E00C0 000114 (v06 CROSVM CROSVMDT 00000001 CROS 00000000)
[    0.000551] ACPI: DSDT 0x00000000000E0080 00003C (v06 CROSVM CROSVMDT 00000001 CROS 00000000)
[    0.000553] ACPI: FACS 0x00000000000E0040 000040
[    0.000555] ACPI: APIC 0x00000000000E0200 000058 (v05 CROSVM CROSVMDT 00000001 CROS 00000000)
[    0.000557] ACPI: Reserving FACP table memory at [mem 0xe00c0-0xe01d3]
[    0.000558] ACPI: Reserving DSDT table memory at [mem 0xe0080-0xe00bb]
[    0.000558] ACPI: Reserving FACS table memory at [mem 0xe0040-0xe007f]
[    0.000558] ACPI: Reserving APIC table memory at [mem 0xe0200-0xe0257]
[    0.000620] Zone ranges:
[    0.000622]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.000624]   DMA32    [mem 0x0000000001000000-0x000000003fffffff]
[    0.000625]   Normal   empty
[    0.000627]   Device   empty
[    0.000628] Movable zone start for each node
[    0.000630] Early memory node ranges
[    0.000632]   node   0: [mem 0x0000000000001000-0x000000000009efff]
[    0.000634]   node   0: [mem 0x0000000000200000-0x000000003fffffff]
[    0.000649] Zeroed struct page in unavailable ranges: 354 pages
[    0.000652] Initmem setup node 0 [mem 0x0000000000001000-0x000000003fffffff]
[    0.009693] Using ACPI for processor (LAPIC) configuration information
[    0.009696] Intel MultiProcessor Specification v1.4
[    0.009698] MPTABLE: OEM ID: CROSVM  
[    0.009698] MPTABLE: Product ID: 000000000000
[    0.009699] MPTABLE: APIC at: 0xFEE00000
[    0.009726] IOAPIC[0]: apic_id 5, version 17, address 0xfec00000, GSI 0-23
[    0.009727] Processors: 4
[    0.009728] TSC deadline timer available
[    0.009729] smpboot: Allowing 4 CPUs, 0 hotplug CPUs
[    0.009749] KVM setup pv sched yield
[    0.009758] [mem 0x40000000-0xffffffff] available for PCI devices
[    0.009759] Booting paravirtualized kernel on KVM
[    0.009760] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[    0.044753] setup_percpu: NR_CPUS:64 nr_cpumask_bits:64 nr_cpu_ids:4 nr_node_ids:1
[    0.045849] percpu: Embedded 49 pages/cpu s168360 r0 d32344 u524288
[    0.045873] KVM setup async PF for cpu 0
[    0.045878] kvm-stealtime: cpu 0, msr 3ea15f80
[    0.045882] Built 1 zonelists, mobility grouping on.  Total pages: 257678
[    0.045883] Kernel command line: reboot=k panic=-1 pci=noacpi console=ttyS0 root=/dev/vda ro
[    0.046511] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.046761] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.046821] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.048344] Memory: 1001648K/1047160K available (14342K kernel code, 1184K rwdata, 2556K rodata, 1456K init, 1116K bss, 45512K reserved, 0K cma-reserved)
[    0.048407] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.048429] ftrace: allocating 42212 entries in 165 pages
[    0.060658] rcu: Preemptible hierarchical RCU implementation.
[    0.060659] rcu:     RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[    0.060660]  Tasks RCU enabled.
[    0.060660] rcu: RCU calculated value of scheduler-enlistment delay is 100 jiffies.
[    0.060661] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.060885] NR_IRQS: 4352, nr_irqs: 456, preallocated irqs: 16
[    0.061130] random: get_random_bytes called from start_kernel+0x203/0x380 with crng_init=0
[    0.157103] printk: console [ttyS0] enabled
[    0.157777] ACPI: Core revision 20190816
[    0.158446] ACPI: setting ELCR to 0020 (from 0000)
[    0.159237] APIC: Switch to symmetric I/O mode setup
[    0.160156] x2apic enabled
[    0.160758] Switched APIC routing to physical x2apic.
[    0.161570] KVM setup pv IPIs
[    0.162628] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x2b2c8ec87c7, max_idle_ns: 440795278598 ns
[    0.164315] Calibrating delay loop (skipped) preset value.. 5990.40 BogoMIPS (lpj=2995200)
[    0.165314] pid_max: default: 32768 minimum: 301
[    0.165314] LSM: Security Framework initializing
[    0.165314] Yama: becoming mindful.
[    0.165314] Chromium OS LSM: enabled
[    0.165314] SELinux:  Initializing.
[    0.165314] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.165314] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.165314] x86/cpu: User Mode Instruction Prevention (UMIP) activated
[    0.165314] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
[    0.165314] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
[    0.165314] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    0.165314] Spectre V2 : Mitigation: Enhanced IBRS
[    0.165314] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[    0.165314] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier
[    0.165314] Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl and seccomp
[    0.165314] Freeing SMP alternatives memory: 40K
[    0.165314] smpboot: CPU0: Intel 06/8c (family: 0x6, model: 0x8c, stepping: 0x1)
[    0.165425] Performance Events: Icelake events, Intel PMU driver.
[    0.166318] ... version:                2
[    0.166934] ... bit width:              48
[    0.167317] ... generic registers:      8
[    0.167943] ... value mask:             0000ffffffffffff
[    0.168317] ... max period:             000000007fffffff
[    0.169165] ... fixed-purpose events:   4
[    0.169319] ... event mask:             0000000f000000ff
[    0.170190] rcu: Hierarchical SRCU implementation.
[    0.170478] smp: Bringing up secondary CPUs ...
[    0.171289] x86: Booting SMP configuration:
[    0.171319] .... node  #0, CPUs:      #1
[    0.104297] kvm-clock: cpu 1, msr 156ff041, secondary cpu clock
[    0.172373] KVM setup async PF for cpu 1
[    0.173314] kvm-stealtime: cpu 1, msr 3ea95f80
[    0.174442]  #2
[    0.104297] kvm-clock: cpu 2, msr 156ff081, secondary cpu clock
[    0.175347] KVM setup async PF for cpu 2
[    0.176314] kvm-stealtime: cpu 2, msr 3eb15f80
[    0.177473]  #3
[    0.104297] kvm-clock: cpu 3, msr 156ff0c1, secondary cpu clock
[    0.178654] KVM setup async PF for cpu 3
[    0.179314] kvm-stealtime: cpu 3, msr 3eb95f80
[    0.180327] smp: Brought up 1 node, 4 CPUs
[    0.181333] smpboot: Max logical packages: 1
[    0.182045] smpboot: Total of 4 processors activated (23961.60 BogoMIPS)
[    0.182514] devtmpfs: initialized
[    0.183358] x86/mm: Memory block size: 128MB
[    0.184330] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[    0.185319] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.186384] xor: automatically using best checksumming function   avx      
[    0.187362] PM: RTC time: 18:40:49, date: 2021-07-19
[    0.188185] thermal_sys: Registered thermal governor 'step_wise'
[    0.188253] NET: Registered protocol family 16
[    0.189128] audit: initializing netlink subsys (disabled)
[    0.189342] audit: type=2000 audit(1626720049.512:1): state=initialized audit_enabled=0 res=1
[    0.190324] cpuidle: using governor ladder
[    0.191332] cpuidle: using governor menu
[    0.192351] KVM setup pv remote TLB flush
[    0.193072] ACPI: bus type PCI registered
[    0.193376] PCI: Using configuration type 1 for base access
[    0.195375] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.196318] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.197359] cryptd: max_cpu_qlen set to 1000
[    0.199351] raid6: using algorithm avx512x4 gen() 0 MB/s
[    0.200317] raid6: .... xor() 0 MB/s, rmw enabled
[    0.201117] raid6: using avx512x2 recovery algorithm
[    0.201334] ACPI: Added _OSI(Module Device)
[    0.202073] ACPI: Added _OSI(Processor Device)
[    0.203316] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.204101] ACPI: Added _OSI(Processor Aggregator Device)
[    0.205316] ACPI: Added _OSI(Linux-Dell-Video)
[    0.206083] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[    0.206319] ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)
[    0.207255] ACPI: 1 ACPI AML tables successfully acquired and loaded
[    0.208419] ACPI: Interpreter enabled
[    0.209044] ACPI: (supports S0 S1 S5)
[    0.210316] ACPI: Using PIC for interrupt routing
[    0.211380] SCSI subsystem initialized
[    0.212087] ACPI: bus type USB registered
[    0.212323] usbcore: registered new interface driver usbfs
[    0.213256] usbcore: registered new interface driver hub
[    0.214320] usbcore: registered new device driver usb
[    0.215205] Advanced Linux Sound Architecture Driver Initialized.
[    0.216326] PCI: Probing PCI hardware
[    0.217007] PCI host bridge to bus 0000:00
[    0.217318] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    0.219317] pci_bus 0000:00: root bus resource [mem 0x00000000-0x7fffffffff]
[    0.220317] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.221334] pci 0000:00:00.0: [8086:1237] type 00 class 0x060000
[    0.222624] pci 0000:00:01.0: [1af4:1042] type 00 class 0xffff00
[    0.232617] pci 0000:00:01.0: reg 0x10: [mem 0xd0000000-0xd0007fff]
[    0.234681] pci 0000:00:02.0: [1af4:1044] type 00 class 0xffff00
[    0.236555] pci 0000:00:02.0: reg 0x10: [mem 0xd0008000-0xd000ffff]
[    0.238601] pci 0000:00:03.0: [1af4:1045] type 00 class 0xffff00
[    0.239558] pci 0000:00:03.0: reg 0x10: [mem 0xd0010000-0xd0017fff]
[    0.242568] pci 0000:00:04.0: [1af4:1041] type 00 class 0xffff00
[    0.243552] pci 0000:00:04.0: reg 0x10: [mem 0xd0018000-0xd001ffff]
[    0.245554] pci 0000:00:05.0: [1af4:1053] type 00 class 0xffff00
[    0.247555] pci 0000:00:05.0: reg 0x10: [mem 0xd0020000-0xd0027fff]
[    0.249504] pci 0000:00:06.0: [1b73:1000] type 00 class 0x0c0330
[    0.250488] pci 0000:00:06.0: reg 0x10: [mem 0xd0030000-0xd003ffff]
[    0.252939] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[    0.254400] clocksource: Switched to clocksource kvm-clock
[    0.270166] FS-Cache: Loaded
[    0.270975] pnp: PnP ACPI init
[    0.271520] pnp: PnP ACPI: found 0 devices
[    0.272400] pci_bus 0000:00: resource 4 [io  0x0000-0xffff]
[    0.273304] pci_bus 0000:00: resource 5 [mem 0x00000000-0x7fffffffff]
[    0.274478] NET: Registered protocol family 2
[    0.275275] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.276585] tcp_listen_portaddr_hash hash table entries: 512 (order: 2, 20480 bytes, linear)
[    0.278063] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.279339] TCP bind hash table entries: 8192 (order: 6, 262144 bytes, linear)
[    0.280648] TCP: Hash tables configured (established 8192 bind 8192)
[    0.281817] UDP hash table entries: 512 (order: 3, 49152 bytes, linear)
[    0.282912] UDP-Lite hash table entries: 512 (order: 3, 49152 bytes, linear)
[    0.284162] NET: Registered protocol family 1
[    0.285071] RPC: Registered named UNIX socket transport module.
[    0.286125] RPC: Registered udp transport module.
[    0.286950] RPC: Registered tcp transport module.
[    0.287784] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.288909] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[    0.290078] pci 0000:00:06.0: PCI->APIC IRQ transform: INT A -> IRQ 10
[    0.291427] PCI: CLS 0 bytes, default 64
[    0.292488] kvm: already loaded the other module
[    0.293322] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x2b2c8ec87c7, max_idle_ns: 440795278598 ns
[    0.295099] clocksource: Switched to clocksource tsc
[    0.295985] platform rtc_cmos: registered platform RTC device (no PNP device found)
[    0.297701] check: Scanning for low memory corruption every 60 seconds
[    0.299109] workingset: timestamp_bits=46 max_order=18 bucket_order=0
[    0.301423] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.302593] fuse: init (API version 7.32)
[    0.303394] 9p: Installing v9fs 9p2000 file system support
[    0.304431] alt_syscall: table 'read_write_test' available.
[    0.305425] alt_syscall: table 'android' available.
[    0.306305] alt_syscall: table 'android_permissive' available.
[    0.307331] alt_syscall: table 'third_party' available.
[    0.308271] alt_syscall: table 'third_party_permissive' available.
[    0.309365] alt_syscall: table 'complete' available.
[    0.310242] alt_syscall: table 'complete_permissive' available.
[    0.312103] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[    0.313441] io scheduler mq-deadline registered
[    0.314233] io scheduler kyber registered
[    0.315040] pci 0000:00:01.0: attach allowed to drvr virtio-pci [trusted device]
[    0.316414] virtio-pci 0000:00:01.0: PCI->APIC IRQ transform: INT A -> IRQ 9
[    0.318695] pci 0000:00:02.0: attach allowed to drvr virtio-pci [trusted device]
[    0.320153] virtio-pci 0000:00:02.0: PCI->APIC IRQ transform: INT A -> IRQ 10
[    0.322134] pci 0000:00:03.0: attach allowed to drvr virtio-pci [trusted device]
[    0.323419] virtio-pci 0000:00:03.0: PCI->APIC IRQ transform: INT A -> IRQ 11
[    0.325391] pci 0000:00:04.0: attach allowed to drvr virtio-pci [trusted device]
[    0.326700] virtio-pci 0000:00:04.0: PCI->APIC IRQ transform: INT A -> IRQ 12
[    0.328601] pci 0000:00:05.0: attach allowed to drvr virtio-pci [trusted device]
[    0.329972] virtio-pci 0000:00:05.0: PCI->APIC IRQ transform: INT A -> IRQ 9
[    0.348714] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.372319] serial8250: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a U6_16550A
[    0.396020] serial8250: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a U6_16550A
[    0.419973] serial8250: ttyS2 at I/O 0x3e8 (irq = 4, base_baud = 115200) is a U6_16550A
[    0.443843] serial8250: ttyS3 at I/O 0x2e8 (irq = 3, base_baud = 115200) is a U6_16550A
[    0.445386] Non-volatile memory driver v1.3
[    0.453265] random: fast init done
[    0.454075] random: crng init done
[    0.463593] loop: module loaded
[    0.470921] virtio_blk virtio0: [vda] 867064 512-byte logical blocks (444 MB/423 MiB)
[    0.472923] libphy: Fixed MDIO Bus: probed
[    0.473707] tun: Universal TUN/TAP device driver, 1.6
[    0.479862] pci 0000:00:06.0: attach allowed to drvr xhci_hcd [trusted device]
[    0.481196] xhci_hcd 0000:00:06.0: PCI->APIC IRQ transform: INT A -> IRQ 10
[    0.482466] xhci_hcd 0000:00:06.0: xHCI Host Controller
[    0.483380] xhci_hcd 0000:00:06.0: new USB bus registered, assigned bus number 1
[    0.485183] xhci_hcd 0000:00:06.0: hcc params 0x30000501 hci version 0x110 quirks 0x0000000000080452
[    0.487195] hub 1-0:1.0: USB hub found
[    0.487955] hub 1-0:1.0: 8 ports detected
[    0.489159] xhci_hcd 0000:00:06.0: xHCI Host Controller
[    0.490077] xhci_hcd 0000:00:06.0: new USB bus registered, assigned bus number 2
[    0.491344] xhci_hcd 0000:00:06.0: Host supports USB 3.0 SuperSpeed
[    0.492482] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    0.493978] hub 2-0:1.0: USB hub found
[    0.494782] hub 2-0:1.0: 8 ports detected
[    0.496005] usbcore: registered new interface driver cdc_acm
[    0.497005] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    0.498385] usbcore: registered new interface driver usb-storage
[    0.499436] usbcore: registered new interface driver usbserial_generic
[    0.500593] usbserial: USB Serial support registered for generic
[    0.501608] usbcore: registered new interface driver ch341
[    0.502576] usbserial: USB Serial support registered for ch341-uart
[    0.503627] usbcore: registered new interface driver cp210x
[    0.504614] usbserial: USB Serial support registered for cp210x
[    0.505654] usbcore: registered new interface driver ftdi_sio
[    0.506662] usbserial: USB Serial support registered for FTDI USB Serial Device
[    0.507909] usbcore: registered new interface driver keyspan
[    0.508912] usbserial: USB Serial support registered for Keyspan - (without firmware)
[    0.510590] usbserial: USB Serial support registered for Keyspan 1 port adapter
[    0.511823] usbserial: USB Serial support registered for Keyspan 2 port adapter
[    0.513067] usbserial: USB Serial support registered for Keyspan 4 port adapter
[    0.514325] usbcore: registered new interface driver pl2303
[    0.515271] usbserial: USB Serial support registered for pl2303
[    0.516305] usbcore: registered new interface driver usb_serial_simple
[    0.518094] usbserial: USB Serial support registered for carelink
[    0.519176] usbserial: USB Serial support registered for zio
[    0.520192] usbserial: USB Serial support registered for funsoft
[    0.521246] usbserial: USB Serial support registered for flashloader
[    0.522338] usbserial: USB Serial support registered for google
[    0.523362] usbserial: USB Serial support registered for libtransistor
[    0.524509] usbserial: USB Serial support registered for vivopay
[    0.525522] usbserial: USB Serial support registered for moto_modem
[    0.526642] usbserial: USB Serial support registered for motorola_tetra
[    0.527777] usbserial: USB Serial support registered for novatel_gps
[    0.528863] usbserial: USB Serial support registered for hp4x
[    0.529871] usbserial: USB Serial support registered for suunto
[    0.530909] usbserial: USB Serial support registered for siemens_mpi
[    0.532209] rtc_cmos rtc_cmos: registered as rtc0
[    0.533061] rtc_cmos rtc_cmos: alarms up to one day, 114 bytes nvram
[    0.534278] device-mapper: ioctl: 4.41.0-ioctl (2019-09-16) initialised: dm-d...@redhat.com
[    0.535842] intel_pstate: CPU model not supported
[    0.536643] usbcore: registered new interface driver usbhid
[    0.537616] usbhid: USB HID core driver
[    0.538393] GACT probability NOT on
[    0.539237] xt_time: kernel timezone is -0000
[    0.540037] IPVS: Registered protocols (TCP, UDP)
[    0.540898] IPVS: Connection hash table configured (size=4096, memory=64Kbytes)
[    0.542232] IPVS: ipvs loaded.
[    0.542791] IPVS: [rr] scheduler registered.
[    0.543687] ipt_CLUSTERIP: ClusterIP Version 0.8 loaded successfully
[    0.544837] Initializing XFRM netlink socket
[    0.545673] NET: Registered protocol family 10
[    0.546581] Segment Routing with IPv6
[    0.547363] NET: Registered protocol family 17
[    0.548081] Bridge firewalling registered
[    0.548733] 8021q: 802.1Q VLAN Support v1.8
[    0.549403] 9pnet: Installing 9P2000 support
[    0.550103] NET: Registered protocol family 40
[    0.552953] IPI shorthand broadcast: enabled
[    0.553640] AVX2 version of gcm_enc/dec engaged.
[    0.554307] AES CTR mode by8 optimization enabled
[    0.555538] sched_clock: Marking stable (452237916, 103297993)->(581481233, -25945324)
[    0.556872] registered taskstats version 1
[    0.557725] Btrfs loaded, crc32c=crc32c-intel
[    0.558516] PM:   Magic number: 13:476:696
[    0.559209] ALSA device list:
[    0.559703]   No soundcards found.
[    0.561371] EXT4-fs (vda): mounted filesystem without journal. Opts: (null)
[    0.562590] VFS: Mounted root (ext4 filesystem) readonly on device 254:0.
[    0.563926] devtmpfs: mounted
[    0.566769] Freeing unused kernel image memory: 1456K
[    0.577344] Write protecting the kernel read-only data: 20480k
[    0.579237] Freeing unused kernel image memory: 1992K
[    0.580742] Freeing unused kernel image memory: 1540K
[    0.581425] Run /sbin/init as init process
[    0.751562] maitred: Starting system log collector
[    0.754959] maitred: system log collector started
[    0.756259] maitred: Starting vsock remote shell daemon
[    0.760324] maitred: vsock remote shell daemon started
[    0.761801] vm_syslog: Bound socket fd 9 at /dev/log
[    0.761979] maitred: Server listening on port 8888
[    0.763740] maitred: Using startup listener port: 7777
[    0.775775] maitred: Failed to notify host system that VM is ready: Socket closed

Daniel Verkamp

unread,
Jul 19, 2021, 6:31:22 PM7/19/21
to Carlos Santa, Chromium OS Development
Hi Carlos,

You can't (easily) start a fully-functional Termina VM with all of the guest integration from the shell by running crosvm directly.  There are several other Crostini-related daemons on the system that won't know about your manually started VM; in particular, maitred's error message is indicating that it is failing to communicate with concierge to inform it that the VM has started, since concierge didn't launch the VM in question.  There is some more Chrome OS developer-oriented information about the Crostini daemons here: https://chromium.googlesource.com/chromiumos/docs/+/HEAD/crostini_developer_guide.md

If you just want to start a basic VM without the Chrome OS integration, you can use the Termina disk image and kernel and launch a barebones shell instead of maitred, something like this:

  crosvm run -r /run/imageloader/termina-dlc/package/root/vm_rootfs.img -c 4 -m 1024 -p init=/bin/bash /run/imageloader/termina-dlc/package/root/vm_kernel

However, that will only have the read-only root filesystem and no other storage, and it won't have any of the normal Chrome OS UI integration, so it is only really appropriate for basic testing of the VM.

Could you expand on what you would like to accomplish by running the VM manually?


--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-dev

Carlos Santa

unread,
Jul 19, 2021, 7:40:43 PM7/19/21
to Chromium OS Development, dver...@chromium.org, Chromium OS Development, Carlos Santa
Hi Daniel,

<  crosvm run -r /run/imageloader/termina-dlc/package/root/vm_rootfs.img -c 4 -m 1024 -p init=/bin/bash /run/imageloader/termina-dlc/package/root/vm_kernel

Yes, thank you, that works for manually launching the VM but as you've said the shell it's pretty minimal and readonly, so unfortunately I can't do much with it, for example, none of the files under /proc are available, is this normal?

<Could you expand on what you would like to accomplish by running the VM manually?

Yes, I was forced this route because I couldn't figure out a way to get some debug or log messages out when issuing 'vmc start termina' command to start a VM with some modifications I've done to it.

For example, I'd like to add a new parameter (--vfio) that gets passed into the crosvm command, and even though I was able to patch vm_host_tools and cros deploy onto the target, the VM fails to  launch but silently fails. I need a way to see the logs as the VM is getting launched, and the only way I could think of was by manually launching the crosvm with the new parameter added, but I've discovered it's not a trivial task to launch the VM manually....

What do u suggest about getting the logs during the launching of the VM?

Here is what I'd like to accomplish:

1. Need to patch crosvm to add --vfio as an extra parameter 
2. Then pass another parameter to the kernel's boot arg : vmc start --dlc-id=termina-dlc --kernel "/mnt/stateful_partition/img_test/vm_kernel" --kernel-param "pci=lastbus=255" --no-start-lxd termina 
3. After I get the shell back, do a quick test with lspci where the new PCI dev I am trying to passthrough is listed

Thanks 

Daniel Verkamp

unread,
Jul 19, 2021, 7:58:10 PM7/19/21
to Carlos Santa, Chromium OS Development
On Mon, Jul 19, 2021 at 4:40 PM Carlos Santa <sant...@gmail.com> wrote:
Hi Daniel,

<  crosvm run -r /run/imageloader/termina-dlc/package/root/vm_rootfs.img -c 4 -m 1024 -p init=/bin/bash /run/imageloader/termina-dlc/package/root/vm_kernel

Yes, thank you, that works for manually launching the VM but as you've said the shell it's pretty minimal and readonly, so unfortunately I can't do much with it, for example, none of the files under /proc are available, is this normal?

Yes, this is normal; since the normal init process is not running, you would have to do any setup manually, e.g. to get a bare minimum of /proc and /sys mounted:

  mount -t proc proc /proc
  mount -t sysfs sys /sys
 

<Could you expand on what you would like to accomplish by running the VM manually?

Yes, I was forced this route because I couldn't figure out a way to get some debug or log messages out when issuing 'vmc start termina' command to start a VM with some modifications I've done to it.

Logs from VM startup have been redirected to a daemon-specific log in recent Chrome OS versions; if you are already in dev mode, you should be able to access them at /home/root/<USER_HASH>/crosvm/log/dGVybWluYQ==.log (the last part is just base64("termina").

You can also see these logs in chrome://system (search for crosvm.log) even if not in dev mode.
 

For example, I'd like to add a new parameter (--vfio) that gets passed into the crosvm command, and even though I was able to patch vm_host_tools and cros deploy onto the target, the VM fails to  launch but silently fails. I need a way to see the logs as the VM is getting launched, and the only way I could think of was by manually launching the crosvm with the new parameter added, but I've discovered it's not a trivial task to launch the VM manually....

What do u suggest about getting the logs during the launching of the VM?

Here is what I'd like to accomplish:

1. Need to patch crosvm to add --vfio as an extra parameter 
2. Then pass another parameter to the kernel's boot arg : vmc start --dlc-id=termina-dlc --kernel "/mnt/stateful_partition/img_test/vm_kernel" --kernel-param "pci=lastbus=255" --no-start-lxd termina 
3. After I get the shell back, do a quick test with lspci where the new PCI dev I am trying to passthrough is listed

If you are already set up to use cros deploy, the easiest method would be to modify concierge to add the new arguments to the crosvm command line and deploy vm_host_tools as described in https://chromium.googlesource.com/chromiumos/docs/+/HEAD/crostini_developer_guide.md#Host-service-changes

Then, combined with the logs mentioned above, you should be able to get the necessary information from a normal Crostini startup (such as launching Terminal) and have all of the usual tools from the container.

Unfortunately the termina rootfs image does not have lspci, so you would not be able to use it when booted manually with vm_rootfs.img unless you use a different rootfs or add another disk with extra tools.
Reply all
Reply to author
Forward
0 new messages