[Solved] Wie real HDD installiertes OS in Virt. wandeln

Allgemeine Diskussionen über den Einsatz von VirtualBox.
Gustel
Posts: 9
Joined: 21. Dec 2019, 15:31

[Solved] Wie real HDD installiertes OS in Virt. wandeln

Post by Gustel »

Hi
ich habe hier so einige alte Laufwerke deren Inhalt ich evtl auch als Gast laufen lassen würde.

Ich denke mal:
Die so einfach einbinden und starten "geht in die Hose".
Die Auswahl " Vorhandene Festplatte verwenden" bezieht sich darauf wo die Virtuelle Platte erzeugt werden soll?

Frage:
  1. Wie also kann ich aus der bestehenden realen HDD eine Virtuelle machen?
  2. Was passiert eigentlich mit den Partitionen der HDD?
  3. kann ich eigentlich in der virtuell erzeugten auch mit "Partitionen" spielen / erzeugen ? oder gibt es immer "nur" eine Systempartition wo alles drin ist?
So, ich will mal meine erste Frage nicht zu sehr überfrachten
Achso
mein Host ist eine Linuxmaschine; alle "normal" installierten Guest (Dos bis Win10) laufen ohne Probleme.

Danke für Eure Aufklärung
Last edited by Gustel on 23. Dec 2019, 17:18, edited 1 time in total.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by mpack »

Answering in English:

I also assume that "old disks" refers to old HDDs with an OS installed on them, and not on old installer CDs.

The easiest way to migrate an existing OS to a VM rather depends on what filesystem is on the HDD, how you will access the disk, and whether or not you have other choices of host OS to do the transfer work. You don't seem to have provided that information.

Ideally, you need to find a "smart" disk imager which can convert the entire disk image, discarding unused sectors. You don't need to worry about partitions, as that is a management issue for the guest OS. Partitions you no longer need are best deleted inside the VM.
Gustel
Posts: 9
Joined: 21. Dec 2019, 15:31

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by Gustel »

well I'll try it in english:

you are right there are some hdd with old Windows or Dos OS installed so the filesystems are FAT / FAT32 and NTFS. I don't really know weather they are bootable
how you will access the disk,
I don't understand that.
and whether or not you have other choices of host OS to do the transfer work.
do you mean with host OS my running Virtual Host system ? (the host system is my Linux PC running with Mageia 7) or a second PC running the old hdd with the old OS on it
Which one has to do the transfer work? the second PC to the virtual Host or the other way round?
Ideally, you need to find a "smart" disk imager which can convert the entire disk image, discarding unused sectors.
running on the second PC? a standalone Disk cloner making a image of the old HDD ? (without unused sectors)
You don't need to worry about partitions, as that is a management issue for the guest OS. Partitions you no longer need are best deleted inside the VM.
but you know that there are Data on disk image
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by mpack »

Gustel wrote:
how you will access the disk,
I don't understand that.
The problem is lack of information. You said "old disks", which to me implies bare drives. How did you intend to read them? Install them in a USB caddy?
Gustel wrote:
and whether or not you have other choices of host OS to do the transfer work.
do you mean with host OS my running Virtual Host system ?
Having a Linux host, I want you know if you are limited to disk imaging tools running on that host. If the drives are in external USB caddies then the imaging work could be done on another PC with a wider range of smart disk imaging solutions available, e.g. Macrium Reflect or Disk2VHD. The only Linux disk imagers I know are dd and CloneZilla, neither of which I recommend.
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by stefan.becker »

Mit VBOX kann man nicht direkt auf eine Festplatte zugreifen. Stattdessen wird auf der Systemfestplatte eine große Datei angelegt, die dann vom VBOX Gast als eigene Festplatte verwendet wird.

Wenn der Gast gestartet ist, kann man nach Belieben formatieren, partitionieren. Das ändert nur was in der großen Datei, aber nichts an den realen Festplatten.

Was du vorhast, lohnt sich vom zeitlichen Aufwand her nicht. Dann lieber das entsprechende Betriebssystem von der alten Platte in VBOX neu installieren. Die alte Platte könnte man dann per USB-Adapter anschließen und relevante Daten in den Gast rüberziehen.

Oder du versuchst es, wie zuvor angeregt.

- Also Platte per USB-Adapter anschließen
- Gast neu anlegen mit Platte in Größe 1:1 wie die olle am USB-Adapter
- Gast mit Linux Image starten (z. B. Knoppix)
- Die olle Platte auf das VBOX Image kopieren (im Gast also so was wie "dd if=/dev/sdX of=/dev/sdY") (X=olle Platte, Y=VBOX Image)
Gustel
Posts: 9
Joined: 21. Dec 2019, 15:31

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by Gustel »

The problem is lack of information. You said "old disks", which to me implies bare drives. How did you intend to read them? Install them in a USB caddy?
you are right "old disks -> bare drives" install in a USB caddy or as another (bootable) drive in an (extra) old PC here are a few of them. after knowing what's on it ( old installed OS with some old Programs ) I thought I will use it as a VM.

The reason why I'm on this idea is:
I've got a Windows 7 running with some Access 2000 mdb. It couldnt easy copied cause they format every Partition (7of them) as a virtual one not as Basic with logical Partitions. The PC could'nt reinstalled without reprogramming the VB Code ( too much work)
dd and CloneZilla
are a bit tricky to use people are missing a GUI and both could'nt act with these virtual Partitions
e.g. Macrium Reflect or Disk2VHD
Macrium Reflect is new for me. Disk2VHD seems to be exact what I want to do. I think I will give them a try
Thanks for the tip
Gustel
Posts: 9
Joined: 21. Dec 2019, 15:31

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by Gustel »

das mit der Festplatte habe ich befürchtet die Option beim Einrichten bedeutet also das ich eine extra reale HD nutze um dort die VM ( den file) zu erzeugen.? also z.B. real 1TB Festplatte oder größer und die VM dann auch <= 1TB ?
Wenn der Gast gestartet ist, kann man nach Belieben formatieren, partitionieren.
da muss ich wohl mal suchen wie / womit das geht. Ich dachte - habe immer nur gefunden das - es immer nur eine Partition bei der Einrichtung vom Gast in der VM gemacht.
Dann lieber das entsprechende Betriebssystem von der alten Platte in VBOX neu installieren.
in den meisten Fällen wirst Du Recht haben. Leider benötigst Du aber immer die entsprechenden Gast Betriebssystemen. Leider ist dies bei dem Auslöser meiner Anfrage jetzt nicht möglich.
Siehe vorhergehende msg. Die reinen Daten sind nicht immer das Problem. Die Leute hätten jede neue Version von Access ( Schwachsinn die App damit aufzubauen; aber zu spät) mitmachen müssen.
- Also Platte per USB-Adapter anschließen
- Gast neu anlegen mit Platte in Größe 1:1 wie die olle am USB-Adapter
- Gast mit Linux Image starten (z. B. Knoppix)
- Die olle Platte auf das VBOX Image kopieren (im Gast also so was wie "dd if=/dev/sdX of=/dev/sdY") (X=olle Platte, Y=VBOX Image)
Hmm USB Adapter -- sollte also auch als SATA am Host gehen
Gast anlegen ( also z.B als Windows 7 ) die Größe wird schlecht 1 TB
Gast starten .. Ok
die olle kopieren .. kann ich eigentlich die einzelnen Partitionen einzeln (irgendwie) auf die VM bekommen? Du sagst: nach Belieben formatieren, partitionieren
Dann müsste ich ja eigentlich
1) die Systempartition kopieren können;
2) MBR einrichten ( durch USB tool am Gast )
3) Gast booten ( oder mit Knoppix gparted) die fehlenden partitionen erstellen und die Daten reinkopieren z.B. wieder mit dd
habe ich das richtig verstanden ?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by scottgus1 »

Gustel wrote:there are some hdd with old Windows or Dos OS installed
You are trying a physical-to-virtual, or P2V. Web-search "P2V site:forums.virtualbox.org" or "P2V {the operating system on the drive} site:forums.virtualbox.org" for how this has been done and what problems you may face.

Older operating systems do not like having the hardware they ran on changed. Windows XP and earlier complain, maybe Vista too(?), and Linux may have grub issues at least. You are basically taking all of one brain's memory and putting it in another brain. Expect some Frankenstein moments.

Stefan.Becker's suggestion:
stefan.becker wrote:Dann lieber das entsprechende Betriebssystem von der alten Platte in VBOX neu installieren. Die alte Platte könnte man dann per USB-Adapter anschließen und relevante Daten in den Gast rüberziehen.

you'd better reinstall the appropriate operating system from the old disk in VBOX. The old disk could then be connected via a USB adapter and relevant data transferred to the guest.
might be a lot easier to get at and use the data. But if you can pull off the P2V, it would be a nice satisfaction.
stefan.becker wrote:Mit VBOX kann man nicht direkt auf eine Festplatte zugreifen.

With VBOX you cannot directly access a hard drive.
Actually this is possible. It's called 'raw disk access', in the Virtualbox manual, section 9.8. It is an expert feature and requires careful handling to avoid data loss. It may also have Frankenstein issues similar to P2V.
Gustel
Posts: 9
Joined: 21. Dec 2019, 15:31

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by Gustel »

You are basically taking all of one brain's memory and putting it in another brain. Expect some Frankenstein moments.
I guess you are right.
I tried to reinstall and use the copied Data -> no chance to get the Access App running
But if you can pull off the P2V, it would be a nice satisfaction.
I will try it. I love nice satisfaction :lol:
section 9.8. It is an expert feature and requires careful handling to avoid data loss. It may also have Frankenstein issues similar to P2V.
by the way it is section 9.7 Well first of all I think I have to read a bit inside the forum.
Gustel
Posts: 9
Joined: 21. Dec 2019, 15:31

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by Gustel »

Was sind denn die benötigten Gastsysteme?
Konzentriere ich mich mal auf ein Problem. die anderen kommen von allein
Na ja .. aktuell auf den Nägeln brennt die Geschichte mit dem Win 7 wie oben beschrieben. Der Besitzer des Rechners bekommt nun "langsam" Panik. Upgrade auf Win 10 ohne Garantie das sein System weiterhin läuft traut er sich nicht. Also soll ich eine VM anlegen.

Daten sind:
OS Win7 32Bit Prof.
HDD 1TB mit 7 Partitionen ( alle als dynamische angelegt die 2te als System und bootfähig; nicht wie meist als Basis und die 4te als Erweiterte mit den anderen als logische drin)
Program Office 2000 Premium ( mit Access)
Access VB hat sich im Laufe der Zeit im Code geändert. Müsste also in einer neuen Variante an all diesen Stellen geändert werden.
Wie angeboten beim Aufruf der mdb bringt "Aktualisieren / Neukompilieren" nichts. :?: :?: Während ich das hier schreibe ist mir aufgefallen das die App sofort startet .. die mdb also nicht per Hand öffne .. da war irgendetwas.. vielleicht belle ich vor dem falschen Baum :?: muss ich nochmal klären.

Also weiter.. die Frage : weitere Partitionen anlegen / verändert läuft nicht über die Einstellungen von Virtualbox sondern wie bei einer realen HDD über das installierte OS ? z.B. also mit irgendeinem Partitionsmanager von Knoppix das gparted. Richtig?

Ich werde mal versuchen mit dem Macrium Reflect zu spielen.
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by stefan.becker »

Man sollte das von dem Rechner aus starten, auf dem dies Windows 7 auch läuft.

Dann eine ausreichend große USB Platte anschließen.

Mit diesem Tool dann aus dem Windows 7 heraus eine vhd-Datei erzeugen: https://docs.microsoft.com/de-de/sysint ... s/disk2vhd

Diese Datei kann VBOX verarbeiten.

Später in VBOX einen neuen Windows 7 Gast anlegen. Aber keine neue Platte (Date) anlegen, sondern auf die existierende vhd-Datei hinweisen.
Gustel
Posts: 9
Joined: 21. Dec 2019, 15:31

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by Gustel »

:) HA.. an diese Fundstellen bin ich auch gerade gekommen

https://www.gaulnet.de/physical-to-virt ... ieren.html#
der Ablauf ist sehr gut beschrieben

in der Free Version von Macrium Reflect kann man leider - wie ich entnommen habe kein Resize der Partitionen machen..
Später in VBOX einen neuen Windows 7 Gast anlegen. Aber keine neue Platte (Date) anlegen, sondern auf die existierende vhd-Datei hinweisen.
gleiche Problem auch hier für mich
- Kopiervorgang Festplatte in Disk-Image
wenn ich die Festplatte kopiere habe ich ca. 1TB in EIN image kopiert mit viel Leerstand. Die dann mit all den unused Sektoren in den Guest einbinden? ! 1 TB ?!
Wenn ich aber die einzelnen Partitionen in einzelne vhd Disk-Images kopiere---- kriege ich die einzelnen dann in EINE ?
Wie bekomme ich die Partitionen um die unbenutzten Sektoren verkleinert ?
Nur Fragen über Fragen.
vielleicht muss ich wohl wirklich mal mit Try and Error arbeiten. Ich arbeite aber nur sehr ungern "am offenen Herzen" sprich am Original
Gustel
Posts: 9
Joined: 21. Dec 2019, 15:31

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by Gustel »

https://www.gaulnet.de/physical-to-virt ... eren.html#

Wer lesen kann ist im Vorteil
Wenn ich es jetzt richtig verstanden habe erfolgt das ganze in 2 Schritten
VHD erstellen und dabei NUR die benötigten Partitionen auswählen
VHD in VDI mit clonehd von VirtualBox wandeln

so bleibt nur die Frage wie ich jetzt die VHD kleiner kriege ( unused Sektor weg)
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Re: Wie real HDD installiertes OS in Virt. wandeln

Post by stefan.becker »

Per CloneVDI umwandeln in ein VDI, dabei die compact-Methode wählen.

CloneVDI läuft unter Linux per WINE.

Wenn der Gast bereits in VBOX läuft, am besten vorher noch eine Datenträgerbereinigung machen (Vollversion inkl. Systemdateien / Updatebereinigung).

viewtopic.php?f=6&t=22422
Post Reply