dockur / windows

Windows inside a Docker container.
MIT License
17.66k stars 1.53k forks source link

You can use the qcow2 format for the disk image file? #188

Closed ggdd2008 closed 7 months ago

ggdd2008 commented 7 months ago

hi kroese: You can use the qcow2 format for the disk image file. If it is possible, how can the parameters be adjusted?

kroese commented 7 months ago

You can do it like this:

environment:
  DISK_FMT: "qcow2"
ggdd2008 commented 7 months ago

hi,kroese What environment variables do I need to set in order to run a Windows qcow2 disk image file that I have already created? Please provide a detailed example.

kroese commented 7 months ago

See this question https://github.com/dockur/windows/issues/185 about the same.

ggdd2008 commented 7 months ago

image image The progress bar keeps loading. After waiting for a long time, a blue screen appears. I don’t know how to solve it.

kroese commented 7 months ago

Do you also have this problem when using the automatic installation? Because now you set MANUAL=Y and Im not sure why.

ggdd2008 commented 7 months ago

image After setting MANUAL to N, my computer won't proceed past "setup is starting," leaving me unsure of how to resolve the issue.

kroese commented 7 months ago

I have no idea to be honest.. It shows this DRIVER PNP WATCHDOG error on the blue screen, but when Googling for that error it can be caused by lots of different things it seems.

ggdd2008 commented 7 months ago

Regardless of whether I use the qcow2 format or not, I encounter the same installation problem with Windows 7, Windows 10, and Windows 2008.

ggdd2008 commented 7 months ago

Once I eliminated the qcow2 disk format and set the environment variable KVM to N, the installation succeeded. But upon accessing the system, I encountered some information—can this be altered to reflect the host machine's details? image

kroese commented 7 months ago

@ggdd2008 If you use KVM it will reflect the host machines CPU there. Without KVM like you did now, the machine runs at maybe 10 percent of the normal speed, so it will not be usable for any real purpose. At least we know now that the problem has something to do with KVM on CentOS, but we still dont have the solution.

ggdd2008 commented 7 months ago

image Is it possible to customize or alter the yellow highlighted section in the image to match the host machine's CPU information?

kroese commented 7 months ago

Only if you enable KVM..

ggdd2008 commented 7 months ago

thanks

kroese commented 7 months ago

I really think that if you upgrade to a newer kernel or newer CentOS the problem with KVM may disappear. So I dont know if thats an option for you?

ggdd2008 commented 7 months ago

I'm considering testing with Ubuntu 22.04; which operating system do you typically use for your tests?

kroese commented 7 months ago

I use Ubuntu for it, but it should also work on other distros as long as its not CentOS.

ggdd2008 commented 7 months ago

I'll run some additional tests here and will provide you with feedback once I have the outcomes.

ggdd2008 commented 7 months ago

hi kroese : I've encountered a new issue where I replaced the data.qcow2 file with my own qcow2 file and renamed it to data.qcow2. However, the system within my qcow2 file does not have the virtio drivers installed (neither for the hard disk nor the network card). This led to a system crash with a blue screen when I tried to start it using the docker-compose file. Could you tell me how to alter the disk and network card drivers in the qemu command to use the compatible ide and e1000 drivers instead? I would appreciate any solution you might suggest, thank you.

kroese commented 7 months ago

Its possible to add extra arguments for IDE and E1000 hardware, but that will not override the existing disk/network so it will still bluescreen because the SCSI devices will stay present also.

It will be a lot easier to just install the VirtIO drivers while its running with the previous environment (the one with which you created the qcow2 file), and then move the qcow2 to this container after it has the drivers included already. Ofcourse this requires you are still able to boot the qcow2 on the old machine (I do not know how you acquired this file).

The other option is to just generate a clean Win2008 install using the automatic install option. And then just copy your files/programs to this new installation instead of using your existing image.

If you really cannot do one of these 2 options, you can also fork this project (and the qemu-docker project) and modify the disk.sh and network.sh code to use the IDE/E1000 devices if you have some programming skills.

ggdd2008 commented 7 months ago

My current qcow2 file contains programs that have been running for many years (and are no longer maintained) along with a large amount of data. I'm hesitant to install virtio drivers for fear of encountering issues. Now, my only option is to modify the disk.sh and network.sh scripts within the qemu-docker project, but I still encounter a blue screen after making modifications. I think the problem still lies in how I modified the disk.sh script.Here is the content of the modified scripts. [root@localhost ~]# vim /root/qemu-docker-master/src/network.sh image Could you advise which function's content within the disk.sh] script needs to be modified? I would appreciate your guidance, thank you.

kroese commented 7 months ago

Looks like you did it correctly. Are you sure the container you build is using the modified files and not just pulling the stock container?

In any case, if you are worried of getting issues by installing the VirtIO drivers why not just make a backup of the qcow2 file before installing the drivers? Then you can never loose anything if it produces a problem.