Linux Guest OS time zone confusion

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Aphrodite
Posts: 29
Joined: 3. Jul 2020, 16:28

Linux Guest OS time zone confusion

Post by Aphrodite »

The BIOS time of Linux is UTC, I found that the time zone of Linux Guest OS is often garbled, and the bios time is local time
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Linux Guest OS time zone confusion

Post by scottgus1 »

Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.

Also, Right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. Zip the VM's .vbox file (not the .vbox-prev file), and post the zip file, using the forum's Upload Attachment tab. (Configure your host OS to show all extensions if the folder that opens does not show a .vbox file.)
Aphrodite
Posts: 29
Joined: 3. Jul 2020, 16:28

Re: Linux Guest OS time zone confusion

Post by Aphrodite »

Guest OS is Android-x86, does not support installing VBox extensions, use the operating system to shut down normally

scottgus1 wrote:Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.

Also, Right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. Zip the VM's .vbox file (not the .vbox-prev file), and post the zip file, using the forum's Upload Attachment tab. (Configure your host OS to show all extensions if the folder that opens does not show a .vbox file.)
Attachments
VBox.zip
log
(31.49 KiB) Downloaded 7 times
Test.zip
.vbox
(1.32 KiB) Downloaded 4 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Linux Guest OS time zone confusion

Post by mpack »

Aphrodite wrote:Guest OS is Android-x86
No it isn't. The first post - and the topic title - clearly says that the guest OS is Linux. So any discussion of Android will be considered off topic here.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Linux Guest OS time zone confusion

Post by scottgus1 »

mpack wrote:
Aphrodite wrote:Guest OS is Android-x86
No it isn't.
Actually, it could be an Android VM, only not-well-labeled forum posting. The VM type is:
00:00:05.934856 Guest OS type: 'Linux26_64'
which seems to fit the VM type in the well-linked "Mpack Android Recipe" viewtopic.php?f=3&t=92683&start=15#p464073 :D

@Aphrodite, the log has a couple time jumps:
00:01:24.656547 GUI: Machine-view #0 unfocused, reason=3
00:11:34.918340 NAT: DHCP offered IP address 10.0.2.15
......
00:15:04.671495 NAT: DHCP offered IP address 10.0.2.15
00:24:38.201767 GUI: Machine-window #0 activated

Are either of these times when you "slept" the host?

FWIW I don't see an indication of the host sleeping during the run of the VM. But I may have missed it, as I don't sleep my hosts while a VM is running, so I'm not familiar what the log might show.

Edit, my mind was on the wrong post when I wrote the struck-through parts, please disregard them.
Aphrodite
Posts: 29
Joined: 3. Jul 2020, 16:28

Re: Linux Guest OS time zone confusion

Post by Aphrodite »

The core of android is Linux, special Linux, the type of Guest OS I choose is Linux 2.x/3.x/4.x (64-bit).

I deleted the Extradata overrides in the log: (Customized hardware device information)

The time inaccuracy problem has existed for a long time and I have no feedback

scottgus1 wrote:
mpack wrote:
Aphrodite wrote:Guest OS is Android-x86
No it isn't.
Actually, it could be an Android VM, only not-well-labeled forum posting. The VM type is:
00:00:05.934856 Guest OS type: 'Linux26_64'
which seems to fit the VM type in the well-linked "Mpack Android Recipe" viewtopic.php?f=3&t=92683&start=15#p464073 :D
Aphrodite
Posts: 29
Joined: 3. Jul 2020, 16:28

Re: Linux Guest OS time zone confusion

Post by Aphrodite »

Windows system BIOS time is equal to local time, Linux BIOS time is UTC. Windows and Linux are different.

My Host OS is Windows 10, Linux (VM) is used as Guest OS, the bios time of Guest OS should be plus or minus my time zone

example:
If I am in +9 time zone, my local time is 10 am. Linux (VM) Guest OS bios time is 1 am. Linux system time is 10 am.
I found that the BIOS time of Android-x86 (VM) is 10am.(local time,not UTC,Maybe because my Host OS is Windows, VBox doesn't handle this time zone difference), and the time after the virtual machine is started becomes 7pm.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Linux Guest OS time zone confusion

Post by fth0 »

Test.vbox wrote:
<RTC localOrUTC="UTC"/>
In the VM configuration, the setting above can be found at System > Motherboard > Hardware Clock in UTC Time, and it's configured correctly for a Linux guest. On the host OS, VirtualBox then acquires the UTC time and uses it in its virtual RTC and other places. It works well for most users having a Linux guest on a Windows host (and in a similar way vice versa). Therefore, I'd assume there is an Android-related issue here.

You could try if setting System > Acceleration > Paravirtualization Interface to None makes a difference.

PS: You should tell us in advance when you obfuscate information in the VBox.log file. How should we trust that you only changed the user name and the VM name (besides the DMI settings)? ;)
Aphrodite
Posts: 29
Joined: 3. Jul 2020, 16:28

Re: Linux Guest OS time zone confusion

Post by Aphrodite »

I've set the paravirtualized interface to none and I don't see an issue with incorrect time.

I checked the documentation of VBox, Paravirtualized interfaces affect clocking.
KVM: Presents a Linux KVM hypervisor interface which is recognized by Linux kernels version 2.6.25 or later. Oracle VM VirtualBox's implementation currently supports paravirtualized clocks and SMP spinlocks. This provider is recommended for Linux guests.
Hyper-V: Presents a Microsoft Hyper-V hypervisor interface which is recognized by Windows 7 and newer operating systems. Oracle VM VirtualBox's implementation currently supports paravirtualized clocks, APIC frequency reporting, guest debugging, guest crash reporting and relaxed timer checks. This provider is recommended for Windows guests.

I just deleted the privacy information in the log, so I didn't make any special instructions.
fth0 wrote: You could try if setting System > Acceleration > Paravirtualization Interface to None makes a difference.

PS: You should tell us in advance when you obfuscate information in the VBox.log file. How should we trust that you only changed the user name and the VM name (besides the DMI settings)? ;)
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Linux Guest OS time zone confusion

Post by scottgus1 »

VM names and host user account names are not hackable info in and of themselves. A VM name is essentially a data file name, and can't be accessed from the web: even if it was known there is no way to get access to the host using it. The user account name can help, if the user account password is also known, as well as which IP address of the 4-billion-ish IPv4 addresses, or the galaxy's worth of IPv6's are known. If you're worried about exposing the user name, then your password isn't 'P@ssW0rd'. :lol:

The only thing that can be in the log that could be hackable is if the host's LAN IP address gets logged. And that's only a problem if your internet comes directly to the host from the modem, not through a typical NAT router that converts the traffic to a private IP address.

Obfuscating log info is OK, as long as the data types that got obfuscated are made known, as in "I obfuscated the VM names and the host user account name".
Post Reply