GuestOS issues on Mac .. please help

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
GVVM
Posts: 20
Joined: 26. Oct 2012, 19:26

GuestOS issues on Mac .. please help

Post by GVVM »

Hello,

Source details
Ubuntu 16 host, running a Lubuntu guest.

Target host is Mac osX

after creating the Lubuntu machine I shutdown normally, zipped the entire VDI folder and copied to Mac machine and started image. SO FAR NO ISSUES.

Then I made changes on the source guest, took a snapshot.

After that I shutdown the guest normally, zipped the entire directory and moved to the Mac host.

Renamed the previous guest directory and unzipped the new one (guest with the snapshot).

Everytime I start, I have the following problems
- it expects me to run fsck (while this never happens on source guest os)

- the postgres database objects that were part of the snapshot disappears; the machine
Starts as the initial image copy

Please help

How do I take snapshots of the guest os
And successfully apply that to a guest is on a different pc

Ganesh
GVVM
Posts: 20
Joined: 26. Oct 2012, 19:26

How do I clone a guest os from Ubuntu host to Mac host

Post by GVVM »

modedit: post merged from a duplicate topic.

I would like to know the steps
To clone and (maintain future snapshots)
For a guest is running on Ubuntu host
And a Host os running Mac OsX

Please help.

Note.. I posted another topic but thought of making it precise and clear
Last edited by mpack on 2. Mar 2020, 12:34, edited 1 time in total.
Reason: edit
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: GuestOS issues on Mac .. please help

Post by scottgus1 »

I suspect that right here is where things might have gone wrong:
GVVM wrote:Renamed the previous guest directory and unzipped the new one
It could be possible that something unique to the old guest was held by Virtualbox. The better way would be to remove the old guest in the main Virtualbox while keeping the old files. Doublecheck that the Virtual Media Manager also does not have the old guest's disk files still registered (if so, 'Release' and 'Remove' the disk files, Keep, don't Delete).

Now register the new guest.

FWIW snapshots are not backups, and they make a guest more delicate.

If you have to do this host-switching a lot, consider keeping the guest on an external drive and taking the drive to each host as needed, or use in-the-guest synchronizing software to keep changes up-to-date and don't use snapshots. Take regular backups, by copying the fully-shut-down guest to other media.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How do I clone a guest os from Ubuntu host to Mac host

Post by scottgus1 »

modedit: post merged from a duplicate topic.

Better to edit the first post than make a forum-rule-breaking duplicate. Story continues here: viewtopic.php?f=8&t=97108
Last edited by mpack on 2. Mar 2020, 12:34, edited 1 time in total.
Reason: Edit
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: GuestOS issues on Mac .. please help

Post by scottgus1 »

FWIW2: This:
GVVM wrote:after creating the Lubuntu machine I shutdown normally, zipped the entire VDI folder and copied to Mac machine
is how to copy a guest to a new host, as asked here: viewtopic.php?f=8&t=97110

The 'VDI folder' would be the guest's folder, containing the guest .vbox file, guest disk file(s) and Logs & Snapshots folders.
GVVM
Posts: 20
Joined: 26. Oct 2012, 19:26

Re: GuestOS issues on Mac .. please help

Post by GVVM »

For your first response, I assume, you're referring too the source machine... If that's the case, since it works fine, I don't want to meet with it.

All issues are on the Mac side.

I have zipped and moved there entire folder containing VDI, snapshots, logs, and sav files.
I'm not sure if there are other files being written too some other location that I should carry..I hope not.

External hard disk is not feasible as the source machine is in East coast, while the Mac is in West coast..

Appreciate any further tips
GVVM
Posts: 20
Joined: 26. Oct 2012, 19:26

Re: GuestOS issues on Mac .. please help

Post by GVVM »

Sorry about the crappy auto correct
GVVM
Posts: 20
Joined: 26. Oct 2012, 19:26

Re: GuestOS issues on Mac .. please help

Post by GVVM »

I have the guest vm working fine on the source host..

Please let me know the steps I should try

So far I tried snapshots and clone/zip
Both are not faithfully copying the DB changes that were .Ade after the initial vm creation.

It keeps complaining that fsck must be run and that
The target path is a read only file system

After running fsck it starts fine but still DB changes are missing
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: GuestOS issues on Mac .. please help

Post by scottgus1 »

GVVM wrote:For your first response, I assume, you're referring too the source machine.
No, I surmise that the rename of the old directory took place on the destination PC. Delete the destination PC's guest and register the full snapshotted copy, instead of slipping in a new directory under the old registration.
GVVM wrote:External hard disk is not feasible as the source machine is in East coast, while the Mac is in West coast..
Yeah, that would be a rrrreeeeaaaallllllyyy long USB cable.... :lol:

If you copy the full guest folder with .vbox, all .vdi's, Logs & Snapshots folders to a new host, the exact state of the data in the guest should be preserved. Simply slipping in new files under an already-registered guest may not work right, especially if there are any Virtualbox windows open, which means the VboxSVC service may be running, which would overwrite the new guest data with the old guest data in memory, which would delete the ability to see the snapshot, which would reset your database changes.

Delete the old guest from Virtualbox as suggested before copying the new snapshotted guest, then register the new guest.
GVVM
Posts: 20
Joined: 26. Oct 2012, 19:26

Re: GuestOS issues on Mac .. please help

Post by GVVM »

While this option worked for the base Image copy, it did not work for subsequent changes to the source "VM".

What I mean by that is, after the SOURCE VM was created a complete zip of the directory (snapshot,log, xml files etc) was taken and moved over to the target machine, While it was setup and opened in the target MAC, each time, it forced me to run fsck which is not ideal. OK, I moved past that and it seems to be functioning fine.

But then, changes were made to the SOURCE VM and the following 2 methods were tried.

1. take snapshot of the source VM and transfer just the snapshot file and apply - DID NOT WORK
2. Take a complete zip of the SOURCE VM directory (snapshot,log, xml files etc) was taken and copied over, this did not work as well!!!!

Each time, the target VM opens up the Original copy of the VM that was installed and configured.

I would appreciate if someone can provide insights.

I thought this would be ideal to create a base image, distribute to the developers, and get them to start working, and whenever any updates were made to the base image, a delta image will be provided to keep them updated and be in-sync. Unfortunately, I am having a hard time with this.


thanks in advance for any suggestions.
GV
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: GuestOS issues on Mac .. please help

Post by scottgus1 »

GVVM wrote:changes were made to the SOURCE VM and the following 2 methods were tried.

1. take snapshot of the source VM and transfer just the snapshot file and apply - DID NOT WORK
2. Take a complete zip of the SOURCE VM directory (snapshot,log, xml files etc) was taken and copied over, this did not work as well!!!!
........
I would appreciate if someone can provide insights.
My insights remain the same. You should not copy modified files underneath an existing Virtualbox guest, especially if there are snapshots involved. Bad things will happen, as you are discovering.

Process 1 is destined to fail. Snapshots cannot simply be added to an existing guest, even if you manually modify the guest's XML. There are way too many places a snapshot file contains data that are only valid on the original guest, and disk errors will develop, as in "it forced me to run fsck".

Process 2 only works if you completely remove the old guest and then register the new guest copy. There are places in the Virtualbox XML files that hold onto UUIDs that could be duplicated or need to be modified to work.

The only way switching files under an existing guest works is to switch only the guest disk file, and only if the new guest disk file has the same UUID as the old disk file, and no snapshots or saved states are involved. Then simply swapping disk file names will change the disk for the guest. Again, no snapshots or saved states.

Find another method to keep your east and west coast guests synchronized. You will keep having trouble if you fight the design of Virtualbox.
GVVM
Posts: 20
Joined: 26. Oct 2012, 19:26

Re: GuestOS issues on Mac .. please help

Post by GVVM »

So for the snapshots to be successfully applied, I have to take
a complete zip of the SOURCE VM after any changes
ship to target location
Delete the old VM image including files from the target machine.
unzip the new image
restart the guest VM on target

is that correct?

Thanks for your help and assistance.

Ganesh
granada29
Volunteer
Posts: 687
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: GuestOS issues on Mac .. please help

Post by granada29 »

It seems to me that what you should be investigating is how to perform database replication between your 2 sites.

Have you considerd using postgres tools such as those described at https://www.howtoforge.com/tutorial/pos ... ntu-15-04/?
Post Reply