# gentoo guest on virtualbox 5.2 is flaky [solved]

## charlton

I'm running virtualbox-5.2.6 on my gentoo host.  Everything works except my gentoo guest VM which I've compiled the kernel myself.  The VM used to work fine under virtualbox-5.0.40, however it flakes out under virtualbox-5.2.6.

Specifically I'm getting disk I/O errors on my SATA drives in the VM.  The following is from the dmesg log:

```

[   60.922209] ata1.00: exception Emask 0x0 SAct 0x7fffffff SErr 0x0 action 0x6 frozen

[   60.922216] ata1.00: cmd 60/08:00:f8:cb:f9/00:00:05:00:00/40 tag 0 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922220] ata1.00: cmd 60/08:08:08:cb:f9/00:00:05:00:00/40 tag 1 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922224] ata1.00: cmd 60/08:10:10:cb:f9/00:00:05:00:00/40 tag 2 ncq dma 4096 in

                        res 40/00:01:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922228] ata1.00: cmd 60/08:18:18:cb:f9/00:00:05:00:00/40 tag 3 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922232] ata1.00: cmd 60/08:20:20:cb:f9/00:00:05:00:00/40 tag 4 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922236] ata1.00: cmd 60/08:28:30:cb:f9/00:00:05:00:00/40 tag 5 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922240] ata1.00: cmd 60/08:30:38:cb:f9/00:00:05:00:00/40 tag 6 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922244] ata1.00: cmd 60/08:38:40:cb:f9/00:00:05:00:00/40 tag 7 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922249] ata1.00: cmd 60/08:40:48:cb:f9/00:00:05:00:00/40 tag 8 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922253] ata1.00: cmd 60/08:48:50:cb:f9/00:00:05:00:00/40 tag 9 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922257] ata1.00: cmd 60/08:50:58:cb:f9/00:00:05:00:00/40 tag 10 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922261] ata1.00: cmd 60/08:58:60:cb:f9/00:00:05:00:00/40 tag 11 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922265] ata1.00: cmd 60/08:60:68:cb:f9/00:00:05:00:00/40 tag 12 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922269] ata1.00: cmd 60/08:68:70:cb:f9/00:00:05:00:00/40 tag 13 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922273] ata1.00: cmd 60/08:70:78:cb:f9/00:00:05:00:00/40 tag 14 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922277] ata1.00: cmd 60/08:78:80:cb:f9/00:00:05:00:00/40 tag 15 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922281] ata1.00: cmd 60/08:80:88:cb:f9/00:00:05:00:00/40 tag 16 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922285] ata1.00: cmd 60/08:88:90:cb:f9/00:00:05:00:00/40 tag 17 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922324] ata1.00: cmd 60/08:90:98:cb:f9/00:00:05:00:00/40 tag 18 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922329] ata1.00: cmd 60/08:98:a0:cb:f9/00:00:05:00:00/40 tag 19 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922333] ata1.00: cmd 60/08:a0:a8:cb:f9/00:00:05:00:00/40 tag 20 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922337] ata1.00: cmd 60/08:a8:b0:cb:f9/00:00:05:00:00/40 tag 21 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922342] ata1.00: cmd 60/08:b0:b8:cb:f9/00:00:05:00:00/40 tag 22 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922346] ata1.00: cmd 60/08:b8:c0:cb:f9/00:00:05:00:00/40 tag 23 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922351] ata1.00: cmd 60/08:c0:c8:cb:f9/00:00:05:00:00/40 tag 24 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922355] ata1.00: cmd 60/08:c8:d0:cb:f9/00:00:05:00:00/40 tag 25 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922359] ata1.00: cmd 60/08:d0:d8:cb:f9/00:00:05:00:00/40 tag 26 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922363] ata1.00: cmd 60/08:d8:e0:cb:f9/00:00:05:00:00/40 tag 27 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922364] ata1.00: cmd 60/08:e0:00:cb:f9/00:00:05:00:00/40 tag 28 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922420] ata1.00: cmd 60/08:e8:e8:cb:f9/00:00:05:00:00/40 tag 29 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922424] ata1.00: cmd 60/08:f0:f0:cb:f9/00:00:05:00:00/40 tag 30 ncq dma 4096 in

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   60.922432] ata1: hard resetting link

[   61.228060] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[   66.582357] ata1.00: qc timeout (cmd 0xec)

[   66.582380] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)

[   66.582382] ata1.00: revalidation failed (errno=-5)

[   66.582390] ata1: hard resetting link

[   66.893302] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[   67.115620] ata3.00: exception Emask 0x0 SAct 0x400 SErr 0x0 action 0x6 frozen

[   67.115627] ata3.00: cmd 61/08:50:00:08:00/00:00:00:00:00/40 tag 10 ncq dma 4096 out

                        res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

[   67.115634] ata3: hard resetting link

[   67.427351] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[   72.758700] ata3.00: qc timeout (cmd 0xec)

[   72.758739] ata3.00: failed to IDENTIFY (I/O error, err_mask=0x4)

[   72.758742] ata3.00: revalidation failed (errno=-5)

[   72.758749] ata3: hard resetting link

[   73.067605] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[   77.379016] ata1.00: qc timeout (cmd 0xec)

[   77.379040] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)

[   77.379042] ata1.00: revalidation failed (errno=-5)

[   77.379048] ata1: limiting SATA link speed to 1.5 Gbps

[   77.379059] ata1: hard resetting link

[   77.696965] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)

[   83.696101] ata3.00: qc timeout (cmd 0xec)

[   83.696158] ata3.00: failed to IDENTIFY (I/O error, err_mask=0x4)

[   83.696165] ata3.00: revalidation failed (errno=-5)

[   83.696177] ata3: limiting SATA link speed to 1.5 Gbps

[   83.696190] ata3: hard resetting link

[   84.009218] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 310)

[  108.422412] ata1.00: qc timeout (cmd 0xec)

[  108.422436] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)

[  108.422438] ata1.00: revalidation failed (errno=-5)

[  108.422441] ata1.00: disabled

[  108.422476] ata1: hard resetting link

[  108.732360] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)

[  108.732389] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08

[  108.732392] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x2 [current]

[  108.732395] sd 0:0:0:0: [sda] tag#0 ASC=0x4 ASCQ=0x21

[  108.732398] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x28 28 00 05 f9 cb f8 00 00 08 00

[  108.732401] print_req_error: I/O error, dev sda, sector 100256760

[  108.732430] sd 0:0:0:0: [sda] tag#1 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08

[  108.732433] sd 0:0:0:0: [sda] tag#1 Sense Key : 0x2 [current]

[  108.732435] sd 0:0:0:0: [sda] tag#1 ASC=0x4 ASCQ=0x21

[  108.732437] sd 0:0:0:0: [sda] tag#1 CDB: opcode=0x28 28 00 05 f9 cb 08 00 00 08 00

[  108.732439] print_req_error: I/O error, dev sda, sector 100256520

[  108.732448] sd 0:0:0:0: [sda] tag#2 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08

[  108.732450] sd 0:0:0:0: [sda] tag#2 Sense Key : 0x2 [current]

[  108.732452] sd 0:0:0:0: [sda] tag#2 ASC=0x4 ASCQ=0x21

[  108.732454] sd 0:0:0:0: [sda] tag#2 CDB: opcode=0x28 28 00 05 f9 cb 10 00 00 08 00

[  108.732456] print_req_error: I/O error, dev sda, sector 100256528

[  108.732464] sd 0:0:0:0: [sda] tag#3 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08

[  108.732467] sd 0:0:0:0: [sda] tag#3 Sense Key : 0x2 [current]

[  108.732469] sd 0:0:0:0: [sda] tag#3 ASC=0x4 ASCQ=0x21

[  108.732471] sd 0:0:0:0: [sda] tag#3 CDB: opcode=0x28 28 00 05 f9 cb 18 00 00 08 00

[  108.732472] print_req_error: I/O error, dev sda, sector 100256536

[  108.732480] sd 0:0:0:0: [sda] tag#4 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08

[  108.732482] sd 0:0:0:0: [sda] tag#4 Sense Key : 0x2 [current]

[  108.732484] sd 0:0:0:0: [sda] tag#4 ASC=0x4 ASCQ=0x21

[  108.732486] sd 0:0:0:0: [sda] tag#4 CDB: opcode=0x28 28 00 05 f9 cb 20 00 00 08 00

[  108.732487] print_req_error: I/O error, dev sda, sector 100256544

[  108.732581] sd 0:0:0:0: [sda] tag#5 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08

[  108.732583] sd 0:0:0:0: [sda] tag#5 Sense Key : 0x2 [current]

[  108.732585] sd 0:0:0:0: [sda] tag#5 ASC=0x4 ASCQ=0x21

[  108.732588] sd 0:0:0:0: [sda] tag#5 CDB: opcode=0x28 28 00 05 f9 cb 30 00 00 08 00

[  108.732589] print_req_error: I/O error, dev sda, sector 100256560

[  108.732597] sd 0:0:0:0: [sda] tag#6 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08

[  108.732600] sd 0:0:0:0: [sda] tag#6 Sense Key : 0x2 [current]

[  108.732602] sd 0:0:0:0: [sda] tag#6 ASC=0x4 ASCQ=0x21

[  108.732604] sd 0:0:0:0: [sda] tag#6 CDB: opcode=0x28 28 00 05 f9 cb 38 00 00 08 00

[  108.732606] print_req_error: I/O error, dev sda, sector 100256568

[  108.732615] sd 0:0:0:0: [sda] tag#7 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08

[  108.732617] sd 0:0:0:0: [sda] tag#7 Sense Key : 0x2 [current]

[  108.732619] sd 0:0:0:0: [sda] tag#7 ASC=0x4 ASCQ=0x21

[  108.732622] sd 0:0:0:0: [sda] tag#7 CDB: opcode=0x28 28 00 05 f9 cb 40 00 00 08 00

[  108.732627] print_req_error: I/O error, dev sda, sector 100256576

[  108.732635] sd 0:0:0:0: [sda] tag#8 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08

[  108.732637] sd 0:0:0:0: [sda] tag#8 Sense Key : 0x2 [current]

[  108.732639] sd 0:0:0:0: [sda] tag#8 ASC=0x4 ASCQ=0x21

[  108.732641] sd 0:0:0:0: [sda] tag#8 CDB: opcode=0x28 28 00 05 f9 cb 48 00 00 08 00

[  108.732642] print_req_error: I/O error, dev sda, sector 100256584

[  108.732650] sd 0:0:0:0: [sda] tag#9 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08

[  108.732652] sd 0:0:0:0: [sda] tag#9 Sense Key : 0x2 [current]

[  108.732654] sd 0:0:0:0: [sda] tag#9 ASC=0x4 ASCQ=0x21

[  108.732656] sd 0:0:0:0: [sda] tag#9 CDB: opcode=0x28 28 00 05 f9 cb 50 00 00 08 00

[  108.732658] print_req_error: I/O error, dev sda, sector 100256592

[  108.732771] ata1: EH complete

[  108.732916] EXT4-fs error (device sda3): __ext4_get_inode_loc:4568: inode #2954329: block 11538789: comm updatedb: unable to read itable block

[  108.733010] Buffer I/O error on dev sda3, logical block 0, lost async page write

[  108.733032] Buffer I/O error on dev sda3, logical block 1, lost async page write

[  108.733035] Buffer I/O error on dev sda3, logical block 2, lost async page write

[  108.733037] Buffer I/O error on dev sda3, logical block 3, lost async page write

[  108.733053] Buffer I/O error on dev sda3, logical block 1030, lost async page write

[  108.733065] Buffer I/O error on dev sda3, logical block 524295, lost async page write

[  108.733077] Buffer I/O error on dev sda3, logical block 524320, lost async page write

[  108.733089] Buffer I/O error on dev sda3, logical block 533254, lost async page write

[  108.733100] Buffer I/O error on dev sda3, logical block 537241, lost async page write

[  108.733112] Buffer I/O error on dev sda3, logical block 542318, lost async page write

[  108.734655] EXT4-fs warning (device sda3): ext4_end_bio:323: I/O error 10 writing to inode 2490371 (offset 0 size 4096 starting block 10987596)

[  108.734658] Buffer I/O error on device sda3, logical block 9994315

[  108.734670] EXT4-fs error (device sda3): ext4_wait_block_bitmap:504: comm kworker/u8:2: Cannot read block bitmap - block_group = 305, block_bitmap = 9961473

[  108.734673] EXT4-fs (sda3): previous I/O error to superblock detected

[  108.734714] EXT4-fs (sda3): Delayed block allocation failed for inode 2490373 at logical offset 0 with max blocks 16 with error 5

[  108.734716] EXT4-fs (sda3): This should not happen!! Data will be lost

[  108.734770] EXT4-fs error (device sda3): ext4_wait_block_bitmap:504: comm kworker/u8:2: Cannot read block bitmap - block_group = 113, block_bitmap = 3670017

[  108.734773] EXT4-fs (sda3): previous I/O error to superblock detected

[  108.734810] EXT4-fs (sda3): Delayed block allocation failed for inode 917508 at logical offset 0 with max blocks 1 with error 5

[  108.734811] EXT4-fs (sda3): This should not happen!! Data will be lost

[  108.734923] EXT4-fs warning (device sda3): ext4_end_bio:323: I/O error 10 writing to inode 659899 (offset 0 size 0 starting block 1158146)

[  108.734925] Buffer I/O error on device sda3, logical block 164865

[  108.734931] EXT4-fs warning (device sda3): ext4_end_bio:323: I/O error 10 writing to inode 659893 (offset 0 size 0 starting block 3909684)

[  108.734933] Buffer I/O error on device sda3, logical block 2916403

[  108.734938] EXT4-fs warning (device sda3): ext4_end_bio:323: I/O error 10 writing to inode 659893 (offset 2875392 size 8192 starting block 3914314)

[  108.734940] Buffer I/O error on device sda3, logical block 2921032

[  108.734942] Buffer I/O error on device sda3, logical block 2921033

[  108.734952] EXT4-fs error (device sda3): ext4_wait_block_bitmap:504: comm kworker/u8:2: Cannot read block bitmap - block_group = 5, block_bitmap = 1030

[  108.734954] EXT4-fs (sda3): previous I/O error to superblock detected

[  108.734990] EXT4-fs (sda3): Delayed block allocation failed for inode 659899 at logical offset 1159 with max blocks 1 with error 5

[  108.734992] EXT4-fs (sda3): This should not happen!! Data will be lost

[  108.735456] EXT4-fs warning (device sda3): ext4_end_bio:323: I/O error 10 writing to inode 1213235 (offset 0 size 0 starting block 2207213)

[  108.735458] Buffer I/O error on device sda3, logical block 1213932

[  108.735466] EXT4-fs warning (device sda3): ext4_end_bio:323: I/O error 10 writing to inode 659903 (offset 0 size 0 starting block 3655567)

[  108.735467] Buffer I/O error on device sda3, logical block 2662286

[  108.735478] EXT4-fs error (device sda3): ext4_wait_block_bitmap:504: comm kworker/u8:2: Cannot read block bitmap - block_group = 5, block_bitmap = 1030

[  108.735480] EXT4-fs (sda3): previous I/O error to superblock detected

[  108.737352] Aborting journal on device sda3-8.

[  108.737391] JBD2: Error -5 detected when updating journal superblock for sda3-8.

[  108.737403] JBD2: Detected IO errors while flushing file data on sda3-8

[  108.737477] EXT4-fs error (device sda3): ext4_journal_check_start:61: Detected aborted journal

[  108.737591] EXT4-fs error (device sda3): ext4_journal_check_start:61: Detected aborted journal

[  108.738709] EXT4-fs error (device sda3): __ext4_get_inode_loc:4568: inode #2954424: block 11538795: comm updatedb: unable to read itable block

[  108.738847] EXT4-fs error (device sda3): ext4_find_entry:1436: inode #2836625: comm updatedb: reading directory lblock 0

[  108.738893] EXT4-fs error (device sda3): ext4_find_entry:1436: inode #2836625: comm updatedb: reading directory lblock 0

[  108.739350] EXT4-fs error (device sda3): __ext4_get_inode_loc:4568: inode #2954460: block 11538797: comm updatedb: unable to read itable block

[  108.739805] EXT4-fs error (device sda3): __ext4_get_inode_loc:4568: inode #2954471: block 11538798: comm updatedb: unable to read itable block

[  108.767591] EXT4-fs warning (device sda3): htree_dirblock_to_tree:977: inode #1503732: lblock 0: comm updatedb: error -5 reading directory block

[  108.767642] EXT4-fs warning (device sda3): htree_dirblock_to_tree:977: inode #3556376: lblock 0: comm updatedb: error -5 reading directory block

[  108.767688] EXT4-fs warning (device sda3): htree_dirblock_to_tree:977: inode #1503733: lblock 0: comm updatedb: error -5 reading directory block

[  108.767730] EXT4-fs warning (device sda3): htree_dirblock_to_tree:977: inode #2836592: lblock 0: comm updatedb: error -5 reading directory block

[  114.624102] ata3.00: qc timeout (cmd 0xec)

[  114.624145] ata3.00: failed to IDENTIFY (I/O error, err_mask=0x4)

[  114.624165] ata3.00: revalidation failed (errno=-5)

[  114.624183] ata3.00: disabled

[  114.624222] ata3: hard resetting link

[  114.955739] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 310)

[  114.955792] ata3: EH complete

[  114.955835] scsi_io_completion: 1301 callbacks suppressed

[  114.955841] sd 2:0:0:0: [sdc] tag#11 UNKNOWN(0x2003) Result: hostbyte=0x04 driverbyte=0x00

[  114.955844] sd 2:0:0:0: [sdc] tag#11 CDB: opcode=0x2a 2a 00 00 00 08 00 00 00 08 00

[  114.955847] print_req_error: 1515 callbacks suppressed

[  114.955849] print_req_error: I/O error, dev sdc, sector 2048

[  114.955852] buffer_io_error: 381 callbacks suppressed

[  114.955854] Buffer I/O error on dev sdc1, logical block 0, lost async page write

```

The VM is on an SSD, so the I/O bandwidth of the host disk should be more than sufficient.  Plus, it was never a problem under virtualbox-5.0.X.

I'm thinking it may be helpful if someone could post their kernel .config from their guest linux VM that is working under virtualbox-5.2?  I know the kernel configuration requirements have changed somewhat.  I believe I have them all correct, but cannot know as the gentoo virtualbox wiki is a little bit dated on guest kernel configuration.Last edited by charlton on Wed Jan 31, 2018 1:30 pm; edited 1 time in total

----------

## NeddySeagoon

charlton,

Those look like real errors. However. which dmesg are they in?

The hosts or the guests?

Do you donate a HDD partition to the guest, so it has actual HDD access or do you use VB hardware emulation to have the guest filesystem in a file on the host that the guest sees as its sda?

Lastly, what does 

```
smartctl -a /dev/sd.. 
```

have to say about the real drive?

----------

## charlton

Thank you for your reply.

 *NeddySeagoon wrote:*   

> charlton,
> 
> Those look like real errors. However. which dmesg are they in?
> 
> The hosts or the guests?

 

These errors are on the guest.

The host is working fine.

 *Quote:*   

> Do you donate a HDD partition to the guest, so it has actual HDD access or do you use VB hardware emulation to have the guest filesystem in a file on the host that the guest sees as its sda?

 

The drives are .vdi files on the host.  Dynamically allocated.

 *Quote:*   

> Lastly, what does 
> 
> ```
> smartctl -a /dev/sd.. 
> ```
> ...

 

I don't have that command anywhere nor could find it in portage, but there's nothing wrong with the actual SSD drive on the host, and I would not be able to run this on the guest (or anything else) once these errors start happening.  I suspect the problem is either in virtualbox 5.1+ or there perhaps are kernel options that I need to use on the guest that I am unaware of (it's already set to tickless, for example).

----------

## NeddySeagoon

charlton,

smartctl is provided by smartmontools.

Is the guest using a partition on the HDD directly, or is its emulated disk in a file on the host?

----------

## charlton

 *NeddySeagoon wrote:*   

> charlton,
> 
> smartctl is provided by smartmontools.

 

Output is as follows (this is on the guest):

```
gentest *ROOT* /root [2]>smartctl -a /dev/sda

smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.11.7-gentoo] (local build)

Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===

Device Model:     VBOX HARDDISK

Serial Number:    VBacd5ae45-2796ef8f

Firmware Version: 1.0

User Capacity:    68,719,476,736 bytes [68.7 GB]

Sector Size:      512 bytes logical/physical

Device is:        Not in smartctl database [for details use: -P showall]

ATA Version is:   ATA/ATAPI-6 published, ANSI INCITS 361-2002

Local Time is:    Thu Jan 25 13:13:16 2018 CST

SMART support is: Unavailable - device lacks SMART capability.

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

gentest *ROOT* /root [3]>
```

 *Quote:*   

> Is the guest using a partition on the HDD directly, or is its emulated disk in a file on the host?

 

Emuldated disk in a .vdi file on the host.  This file is in a directory on an SSD drive.

Actually, I was able to emerge sys-apps/smartmontools by booting into the 4.11 kernel (which also has the problem, but happens far less frequently).  This is why I believe a different kernel configuration may help.

If you have a stable linux guest running under virtualbox 5.2, could you maybe post the .config?  That's all I can think of.  It's either that or a bug in virtualbox.

----------

## NeddySeagoon

charlton,

Can you run that command on the host too please?

I use KVM for Gentoo guests on Gentoo.  Thinking about your kernel config, post the 

```
lspci -knn
```

from the guest and put the guests kernel .config onte a pastebin site.

wgetpaste will help.

----------

## charlton

 *NeddySeagoon wrote:*   

> charlton,
> 
> Can you run that command on the host too please?

 

Here's the output for the disk on the host:

```
bach *ROOT* /root [19]>smartctl -a /dev/sda

smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.14.15-gentoo] (local build)

Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===

Model Family:     Samsung based SSDs

Device Model:     Samsung SSD 850 PRO 1TB

Serial Number:    S2BBNEAG112134Z

LU WWN Device Id: 5 002538 85013d6fa

Firmware Version: EXM02B6Q

User Capacity:    1,024,209,543,168 bytes [1.02 TB]

Sector Size:      512 bytes logical/physical

Rotation Rate:    Solid State Device

Device is:        In smartctl database [for details use: -P show]

ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4c

SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)

Local Time is:    Thu Jan 25 16:17:04 2018 CST

SMART support is: Available - device has SMART capability.

SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

General SMART Values:

Offline data collection status:  (0x00) Offline data collection activity

                                        was never started.

                                        Auto Offline Data Collection: Disabled.

Self-test execution status:      (   0) The previous self-test routine completed

                                        without error or no self-test has ever

                                        been run.

Total time to complete Offline

data collection:                (    0) seconds.

Offline data collection

capabilities:                    (0x53) SMART execute Offline immediate.

                                        Auto Offline data collection on/off support.

                                        Suspend Offline collection upon new

                                        command.

                                        No Offline surface scan supported.

                                        Self-test supported.

                                        No Conveyance Self-test supported.

                                        Selective Self-test supported.

SMART capabilities:            (0x0003) Saves SMART data before entering

                                        power-saving mode.

                                        Supports SMART auto save timer.

Error logging capability:        (0x01) Error logging supported.

                                        General Purpose Logging supported.

Short self-test routine

recommended polling time:        (   2) minutes.

Extended self-test routine

recommended polling time:        ( 543) minutes.

SCT capabilities:              (0x003d) SCT Status supported.

                                        SCT Error Recovery Control supported.

                                        SCT Feature Control supported.

                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 1

Vendor Specific SMART Attributes with Thresholds:

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0

  9 Power_On_Hours          0x0032   093   093   000    Old_age   Always       -       35300

 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       122

177 Wear_Leveling_Count     0x0013   096   096   000    Pre-fail  Always       -       235

179 Used_Rsvd_Blk_Cnt_Tot   0x0013   100   100   010    Pre-fail  Always       -       0

181 Program_Fail_Cnt_Total  0x0032   100   100   010    Old_age   Always       -       0

182 Erase_Fail_Count_Total  0x0032   100   100   010    Old_age   Always       -       0

183 Runtime_Bad_Block       0x0013   100   100   010    Pre-fail  Always       -       0

187 Uncorrectable_Error_Cnt 0x0032   100   100   000    Old_age   Always       -       0

190 Airflow_Temperature_Cel 0x0032   075   048   000    Old_age   Always       -       25

195 ECC_Error_Rate          0x001a   200   200   000    Old_age   Always       -       0

199 CRC_Error_Count         0x003e   100   100   000    Old_age   Always       -       0

235 POR_Recovery_Count      0x0012   099   099   000    Old_age   Always       -       107

241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       72534441947

SMART Error Log Version: 1

No Errors Logged

SMART Self-test log structure revision number 1

No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1

 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS

    1        0        0  Not_testing

    2        0        0  Not_testing

    3        0        0  Not_testing

    4        0        0  Not_testing

    5        0        0  Not_testing

Selective self-test flags (0x0):

  After scanning selected spans, do NOT read-scan remainder of disk.

If Selective self-test is pending on power-up, resume after 0 minute delay.

bach *ROOT* /root [20]>
```

Interesting stuff that I've never seen before.  Looks good though.

 *Quote:*   

> I use KVM for Gentoo guests on Gentoo.  Thinking about your kernel config, post the 
> 
> ```
> lspci -knn
> ```
> ...

 

Yes, more and more I'm considering scrapping virtualbox in favor of virt-manager with KVM, but last time I tried (last year), it was a less than satisfying experience.

Here's the kernel .config on the guest:   https://pastebin.com/k4HMGeYD

----------

## NeddySeagoon

charlton,

That's a 1TB drive and it claims you have written 36.25TB of data to it.

Its good for 1 PB or so, so its nowhere near the end of its write life.

All the other signs look good too.

I can't check your kernel without the 

```
lspci -knn
```

After a quick look, there is nothing making the hairs on the back of my neck stand up.

----------

## charlton

 *NeddySeagoon wrote:*   

> I can't check your kernel without the 
> 
> ```
> lspci -knn
> ```
> ...

 

Yeah, pretty sure the kernel is relatively solid, but there isn't an official source that I know of for what kernel options are required since 5.1+.  Perhaps something needs to be enabled on the bus options, or timing/tickless stuff.  Not sure.

```
gentest *ROOT* /root [1]>lspci -knn

00:00.0 Host bridge [0600]: Intel Corporation 440FX - 82441FX PMC [Natoma] [8086:1237] (rev 02)

00:01.0 ISA bridge [0601]: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] [8086:7000]

00:01.1 IDE interface [0101]: Intel Corporation 82371AB/EB/MB PIIX4 IDE [8086:7111] (rev 01)

        Kernel driver in use: ata_piix

00:02.0 VGA compatible controller [0300]: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter [80ee:beef]

        Kernel modules: vboxvideo

00:03.0 Ethernet controller [0200]: Intel Corporation 82540EM Gigabit Ethernet Controller [8086:100e] (rev 02)

        Subsystem: Intel Corporation PRO/1000 MT Desktop Adapter [8086:001e]

        Kernel driver in use: e1000

00:04.0 System peripheral [0880]: InnoTek Systemberatung GmbH VirtualBox Guest Service [80ee:cafe]

        Kernel driver in use: vboxguest

        Kernel modules: vboxguest

00:05.0 Multimedia audio controller [0401]: Intel Corporation 82801AA AC'97 Audio Controller [8086:2415] (rev 01)

        Subsystem: Dell 82801AA AC'97 Audio Controller [1028:0177]

        Kernel driver in use: snd_intel8x0

00:06.0 USB controller [0c03]: Apple Inc. KeyLargo/Intrepid USB [106b:003f]

        Kernel driver in use: ohci-pci

00:07.0 Bridge [0680]: Intel Corporation 82371AB/EB/MB PIIX4 ACPI [8086:7113] (rev 08)

00:0d.0 SATA controller [0106]: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] [8086:2829] (rev 02)

        Kernel driver in use: ahci

gentest *ROOT* /root [2]>
```

----------

## NeddySeagoon

charlton,

That's interesting

```
00:01.1 IDE interface [0101]: Intel Corporation 82371AB/EB/MB PIIX4 IDE [8086:7111] (rev 01)

        Kernel driver in use: ata_piix 

00:0d.0 SATA controller [0106]: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] [8086:2829] (rev 02)

        Kernel driver in use: ahci
```

You have two emulated HDD controllers. Which one are you using?

Both the ata_piix and ahci interfaces will appear to the guest as SCSI.

In the VBox VM configuration, move the Virtual HDD to the other interface and see what happens.  

VM booting should not be affected unless you have several  Virtual HDDs on the VM.

----------

## charlton

 *NeddySeagoon wrote:*   

> charlton,
> 
> That's interesting
> 
> ```
> ...

 

One is the IDE controller, which the CDROM was on.  The configuration has been like that since 5.0.40, which worked.   I played around with it just to see if that made a difference, so I removed the CDROM and IDE bridge from the VM configuration.  I still had the problem so then I recompiled the kernel without that driver.  Still have the problem, even though the lspci command no longer lists the driver:

```
gentest *ROOT* /root [1]>lspci -knn

00:00.0 Host bridge [0600]: Intel Corporation 440FX - 82441FX PMC [Natoma] [8086:1237] (rev 02)

00:01.0 ISA bridge [0601]: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] [8086:7000]

00:02.0 VGA compatible controller [0300]: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter [80ee:beef]

        Kernel driver in use: vboxvideo

        Kernel modules: vboxvideo

00:03.0 Ethernet controller [0200]: Intel Corporation 82540EM Gigabit Ethernet Controller [8086:100e] (rev 02)

        Subsystem: Intel Corporation PRO/1000 MT Desktop Adapter [8086:001e]

        Kernel driver in use: e1000

00:04.0 System peripheral [0880]: InnoTek Systemberatung GmbH VirtualBox Guest Service [80ee:cafe]

        Kernel driver in use: vboxguest

        Kernel modules: vboxguest

00:05.0 Multimedia audio controller [0401]: Intel Corporation 82801AA AC'97 Audio Controller [8086:2415] (rev 01)

        Subsystem: Dell 82801AA AC'97 Audio Controller [1028:0177]

        Kernel driver in use: snd_intel8x0

00:06.0 USB controller [0c03]: Apple Inc. KeyLargo/Intrepid USB [106b:003f]

00:07.0 Bridge [0680]: Intel Corporation 82371AB/EB/MB PIIX4 ACPI [8086:7113] (rev 08)

00:0d.0 SATA controller [0106]: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] [8086:2829] (rev 02)

        Kernel driver in use: ahci

gentest *ROOT* /root [2]>
```

I suspect if I moved my disks over to IDE instead of SATA, the problem might go away.  That'll involve a bit of work on the guest side, but I strongly suspect the bug is in virtualbox.  It's been this way since 5.1+.

----------

## NeddySeagoon

charlton,

The guest should just work.  The Virtual Disk will still be sda.

If the errors vanish it points to the Virtualbox SATA hardware emulation.

----------

## charlton

 *NeddySeagoon wrote:*   

> The guest should just work.  The Virtual Disk will still be sda.
> 
> If the errors vanish it points to the Virtualbox SATA hardware emulation.

 

I'm sure it is the Virtualbox SATA hardware emulation.

Nevertheless I need this VM working so I moved everything over to the IDE controller.

I have it set as the Primary Master.  It's weird because it did find grub and the boot kernels,

however it could not find the root fs (should be sda3 but it doesn't even see anything but sda1).

Perhaps the structure of the .vdi file is different for IDE drives than SATA?

https://imagebin.ca/v/3padDHZCXyLW

One thing I should add is that I do have other virtual machines with SATA controllers running

Windows and they work fine.  So that leads me to think kernel configuration/parameters could

fix the problem.

----------

## charlton

Tried booting the livecd and mounting the filesystem, chrooted to it, and ran the system a while.  Did a complete emerge update, and everything ran fine!  This is with the original SATA configuration, so it seems there's something in the kernel configuration that's throwing it off.  I like to make my kernels monolithic but I've noticed before there are cases where running it with modules plugged in works better.

Again, I wish there was something published somewhere about kernel config under virtualbox-5.2.  It's gonna be a long process, but if I figure it out I'll leave my findings here.

----------

## charlton

I got lucky and have been able to narrow it down to a few kernel options that are causing this.  None of which are currently documented as far as I see.  

Still testing.  Will post the results soon.

----------

## charlton

Ok, the kernel option that is causing this is:

Power management and ACPI options  --->  ACPI (Advanced Configuration and Power Interface) Support

This option must be turned ON!

Doesn't make sense given that it's a virtual machine, but that's what's been causing this problem.

This option appears to enable a slew of other options, and I am not completely sure which is necessary and which isn't.  I just accepted the defaults.

----------

## Hu

ACPI is a complex standard that provides significant functionality, not all of which is related to "Power" in the sense that most people first imagine.  Generally, any recent x86 hardware, including virtual hardware, should have ACPI enabled.

----------

## charlton

 *Hu wrote:*   

> ACPI is a complex standard that provides significant functionality, not all of which is related to "Power" in the sense that most people first imagine.  Generally, any recent x86 hardware, including virtual hardware, should have ACPI enabled.

 

Now I know.

Unfortunately, the wiki on this stuff is horribly outdated https://wiki.gentoo.org/wiki/VirtualBox

These necessary kernel options aren't documented anywhere else (for Gentoo or any other distro) as far as I can tell.

How is anyone supposed to know this?

Incidently I've scoured the internet for these error messages under virtualbox and no luck either.

The only hits lead people to believe that perhaps the host drive cannot keep up with the I/O of the VM, but that is not the case.

So anyway, at least it's documented here for posterity.

----------

## Hu

ACPI is default-enabled for X86 and IA64 in the Kconfig language.  Unlike some options, it unfortunately does not include in its help text any advice about how to pick a default.  I assume most people do not disable options without knowing the consequences, so most people benefit from the default y.

I see no reason not to more explicitly document this requirement.  If you have a Wiki account, go ahead and add it.

----------

