Move a VM from one computer to another including the shared folder

Discussions related to using VirtualBox on Linux hosts.
chameau
Posts: 30
Joined: 11. Aug 2019, 18:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Windows 7 pro

Move a VM from one computer to another including the shared folder

Post by chameau »

I run VitualBox (V7.0) on a laptop (thinkpad x230t) with Manjaro 21 as the 'host' and Windows 7 as a 'guest' As part of the system I also have a shared folder on the laptop under /Home/Documents/VMsharefolder
I also have a desktop computer of the same vintage with the same OS and everything else pretty much identical. I want to move the VM to the desktop. It's very unlikely that I will run the VMs concurrently, so I will probably not change the MAC address.
The hardware specs of the desktop are:
Motherboard: Gigabyte Z68A-D3-B3
CPU: Intel i5-3470
Ram: 16gb
GPU: NVIDIA GeForce GTX 550 Ti

I would like to copy/move the Windows 7 VM to the desktop. I seen and read many post about that, some go through the export/import functions, others advocate to just simply copy the VirtualBox VMs folder to the new hdd on the desktop computer and then some re-linking to be done, but I can't find anything about how to re-locate the shared folder? The shared folder is very important to me as it hold some Windows programes.
Is it just a mater of copying the folder across and as long as I keep the exact same names and location on the desktop as on the laptop, the VM will find the shared folder?

Could you advice if it is better to use: Clone, or Import/Export, or just copy/move key folders? Thanks
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Move a VM from one computer to another including the shared folder

Post by mpack »

We have a FAQ to cover that: Howto: Move a VM.

It doesn't mention shared folders because that's trivial. As long as the guest sees the same share name, it doesn't care where the share is located.
chameau
Posts: 30
Joined: 11. Aug 2019, 18:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Windows 7 pro

Re: Move a VM from one computer to another including the shared folder

Post by chameau »

Thanks I followed the FAQ instruction and I made sure to replicated the naming and location of the VM folder and the VM share folder. It all worked fine - As I have a better CPU and more RAM on the desktop, I change a few settings (more cores, more memory, more video memory and 3D acceleration). Windows started ok, but found some new hardware and wanted a re-start. Unfortunately upon re-start Windows crashed and I needed to run it with some repair function - after a couple of re-starts it did fix itself and is now working fine. As Virtualbox emulates it's own hardware and does not directly use the guest hardware, the only new hardware I can think of would be the keyboard and mouse combo - I'm surprised that caused an issue!
Anyway all good, thanks for your help
chameau
Posts: 30
Joined: 11. Aug 2019, 18:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Windows 7 pro

Re: Move a VM from one computer to another including the shared folder

Post by chameau »

Alas my last reply was premature! The Windows7 VM keeps on crashing and can no longer be repaired (by Windows)

The process to crash are as follow:
Click on menu (bottom left)
Right click 'Computer'
Click on 'Manage'
Nothing appears to happen for about 10 seconds, then the desktop icons disappear, about 5 to 10 seconds later Windows crashes, a small blue window appears with error messages (doesn't stay long enough to read), then black window with white text with various re-starting options, attempt repair = unsuccessful....
I shut it down - can no longer get it to start....

I will re-copy from the original location (the laptop) and re-register the VM in the desktop, unless you advice otherwise.
Would it be better if I Export to an appliance and import into desktop?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Move a VM from one computer to another including the shared folder

Post by mpack »

Do not use export/import unless the target is e.g. VMware.

I find it unlikely that your crash problems have anything to do with moving the VM. It will have to do with the suitability of the old configuration on the new PC. To sort that out we need to see a VM log from the new PC. Make sure the VM is fully shut down, then right click it in the manager UI. Select "Show Log" and save "VBox.log" (no other file) to a zip file. Attach the zip here.
chameau
Posts: 30
Joined: 11. Aug 2019, 18:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Windows 7 pro

Re: Move a VM from one computer to another including the shared folder

Post by chameau »

After a close inspection, I realized that I have a version mismatch! Virtualbox is version 7.0.2, while the extension pack is version 7.0.4
I uninstalled the extension pack and I did NOT re-install version 7.0.2
I tried to run Windows VM, but still no good.... I assume the damage the mismatch did to the Windows VM is not reversible by uninstalling the extension pack.

I attach the VBox.log as requested, but as this log is of after I uninstalled the extension pack, I also attach the previous log (Log1) in case you need to see it.
Thanks.
Log-VM-Windows7Pro-2022-12-04-17-42-15.log.zip
VBox.log
(32.81 KiB) Downloaded 4 times
Log1-VM-Windows7Pro-2022-12-04-11-42-45.log.zip
VBox.log1
(35.78 KiB) Downloaded 2 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: Move a VM from one computer to another including the shared folder

Post by mpack »

Having an extension pack mismatch shouldn't cause any permanent damage, just certain functions will not be available, or the software might crash. So if the problem continues then the extpack version mismatch can be discounted as the cause.

Please check if you have some KVM app running on the Linux host, or KVM features enabled in the kernel. KVM can conflict with VirtualBox, certainly if the apps run at the same time.

And please reduce the guest CPU allocation to 2 cores. You have a total of 4 cores so it makes no sense to allocate all 4 to guest code, leaving 0 cores for VirtualBox and the other host OS apps.
chameau
Posts: 30
Joined: 11. Aug 2019, 18:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Windows 7 pro

Re: Move a VM from one computer to another including the shared folder

Post by chameau »

To my knowledge I don't have any KVM app installed, unless they are included in the standard Manjaro-Cinnamon install. A search for: Virt-manager or QEMU produced no result. In Settings/System/Acceleration 'Paravirtualization' interface is set to 'Default' and 'Enable Nested Paging' is ticked.
The laptop, where I copied the VM from, has the exact same OS, same version, same applications, and the VM works fine - so I don't think that's the problem. On both machines, I enabled 'Virtualization' in the BIOS and as far as I know that is a requirement to run a VM?
I set 4 cores because Settings/System/Processors show 8 cores in total - Are you sure I only have 4 cores?? see screenshot below.
SettingsSystem061222.png
SettingsSystem061222.png (47.08 KiB) Viewed 2532 times

Windows VM does not work anymore (it probably messed it self-up trying to repair it self), so in the next day or so, I'm going to delete the VM and it's files and then re-install it.
chameau
Posts: 30
Joined: 11. Aug 2019, 18:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Windows 7 pro

Re: Move a VM from one computer to another including the shared folder

Post by chameau »

'Mpack' you are of course right my CPU has only 4 cores! I did a bit more googling/reading and turns out that what Virtualbox lists as CPUs are actually 'Treads' (my CPU has 4 cores and 2 treads per core = 8 treads). So when I sellected 4 CPUs, I thought that a assigned 2 cores with 2 treads each leaving the host with the same, but looks like Virtualbox assigned 4 cores x 1 tread leaving the host with only 4 treads??? and what? sharing the cores?? I don't know?? Maybe Virtualbox should change the description CPUs to Treads??? that may avoid the confusion......
Anyway I reinstalled Windows7 with just a few different settings and it works perfectly fine. The different settings are:
1) Just 1 core
2) Under System/Acceleration/Paravirtualization I selected 'Hyper-V'
I do however get an error message each time I open Virtualbox (see attached below) but Virtualbox works as expected - the error doesn't cause an issue! Would nice to know why and if it can be fixed.
virtualboxerror.png
virtualboxerror.png (72.88 KiB) Viewed 2325 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Move a VM from one computer to another including the shared folder

Post by scottgus1 »

From some reading here: fth0: viewtopic.php?f=8&t=98388&start=15#p477214 and on the volunteers subforum (which you can't get access to yet): viewtopic.php?f=18&t=95738#p463868

Virtualbox doesn't actually take "CPU cores" away from the host to give them to the VM. Virtualbox actually starts the specified number of "threads" (computing processes (?) not actual executables) on the host OS. The host OS decides when and how to compute the VM's threads.

It is possible to assign as many or more threads to the VM than the host has cores. Under esoteric circumstances such as code compiling in the VM, more VM threads than host cores is possibly OK. Under normal circumstances, less VM threads than host cores is best, to keep the host from getting swamped. Swamping the host will be bad for inexperienced users.

Virtualbox source code acknowledges that some esoteric uses may be run, but most uses should not exceed the host CPU core count, in its coloring of the VM's CPU slider. The source code asks the host OS, "How many physical CPU Cores do you have?" The host OS comes back, "I have X physical cores." Virtualbox colors the slider green up to X, then red up to X times 2.

Forum advice to pull folks out of the fire when their host gets slogged down and they've set the slider to all green (or to keep them from having trouble) is to not use all green. Most often, the forum suggests to use 2 processors in the VM (unless it's a really old host and it only has one core - our advice then is to get a new PC :lol: ).
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: Move a VM from one computer to another including the shared folder

Post by fth0 »

@scottgus1:
Well explained! :) I'll just add a few lines to elaborate on the implicit question here:
scottgus1 wrote:Virtualbox doesn't actually take "CPU cores" away from the host to give them to the VM. Virtualbox actually starts the specified number of "threads" (computing processes (?) not actual executables) on the host OS. The host OS decides when and how to compute the VM's threads.
In general OS terminology, a program is a set of instructions that typically resides on a disk. A process is an instance of an executing program. If a process wants to execute several tasks in parallel, it can spawn threads (or additional processes).

The VirtualBox program running a VM is named VirtualBoxVM on Linux (VirtualBoxVM.exe on Windows). The VirtualBoxVM process spawns 42-ish threads to execute several tasks in parallel: One thread for each virtual CPU, others for the Shared Clipboard, Shared Folders, timers, graphics and so on. At any time, some of those threads are running on the host OS, next to tens or hundreds of other processes and threads, and the host OS decides when to run what on its CPU cores and hyperthreads.

Note that it's easy to confuse the OS threads with CPU hyperthreads when using both terms together.
chameau
Posts: 30
Joined: 11. Aug 2019, 18:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Windows 7 pro

Re: Move a VM from one computer to another including the shared folder

Post by chameau »

I asked for an explanation of CPUs/Cores/Treads and 'Scottgus1' and 'Fth0' gave me an explanation - Thank You, but it's way over my head! all I can get is that it is a lot more complicated than I thought.
I initially started this post for help/advice to move a VM from 1 PC to another. I followed the steps and moved the VM successfully - or so I thought...
chameau wrote:Alas my last reply was premature! The Windows7 VM keeps on crashing and can no longer be repaired (by Windows)

The process to crash are as follow:
Click on menu (bottom left)
Right click 'Computer'
Click on 'Manage'
Nothing appears to happen for about 10 seconds, then the desktop icons disappear, about 5 to 10 seconds later Windows crashes, a small blue window appears with error messages (doesn't stay long enough to read), then black window with white text with various re-starting options, attempt repair = unsuccessful....
I shut it down - can no longer get it to start....

I will re-copy from the original location (the laptop) and re-register the VM in the desktop, unless you advice otherwise.
So I did reinstall the VM with only 2 changes from the first time.
1) 1 CPU instead of 4 CPU
2) Under System/Acceleration/Paravirtualization I selected 'Hyper-V' instead of 'Default'
And now it works perfectly fine except for that error message (see previous screenshot) that does not seem to affect it.
So from what I can get from your explanation about the CPUs in Virtualbox, I'm not sure anymore if it was the '4 CPU' setting that caused the crashes?
And second question is: I'm still wondering what this error message means and what I can do about it (if anything)?
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: Move a VM from one computer to another including the shared folder

Post by fth0 »

chameau wrote:Thank You, but it's way over my head! all I can get is that it is a lot more complicated than I thought.
You're welcome! :) And don't worry, you're not alone. The more I know, the more I know what I don't know. ;)

Regarding your original problem, the VM-Windows7Pro-2022-12-04-17-42-15 2.log file indicated VirtualBox 7.0.2 being used, but no problem cause. Since VirtualBox 7.0.4 is current, investigating errors from VirtualBox 7.0.2 is regarded pointless most of the time. Can you still reproduce the error message with VirtualBox 7.0.4?
chameau
Posts: 30
Joined: 11. Aug 2019, 18:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Windows 7 pro

Re: Move a VM from one computer to another including the shared folder

Post by chameau »

Regarding your original problem, the VM-Windows7Pro-2022-12-04-17-42-15 2.log file indicated VirtualBox 7.0.2 being used, but no problem cause. Since VirtualBox 7.0.4 is current, investigating errors from VirtualBox 7.0.2 is regarded pointless most of the time. Can you still reproduce the error message with VirtualBox 7.0.4?
The error message is actually from the second install that was updated to 7.0.4 including the extension pack and guest addition, so yes it is.

Edit: I assume current log file is needed to check the error - attached
VM704-Windows7Pro-2022-12-11-22-58-06.log.zip
(34.33 KiB) Downloaded 2 times
chameau
Posts: 30
Joined: 11. Aug 2019, 18:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Windows 7 pro

Re: Move a VM from one computer to another including the shared folder

Post by chameau »

It's almost been a week since my last post. I still got the same error each time I open Virtualbox! While It's not causing any issues with the running of the 'Guest', I would still like to know what's causing the error? Any idea?
Post Reply