0

I run ubuntu on qemu virtual box with this command:

"D:\Program Files\qemu\qemu-system-x86_64.exe" -hda myimage.img -nographic -enable-kvm -accel hax -enable-hax -m 1G -net user,hostfwd=tcp::22-:22 -redir tcp:5000::5000 -net nic

Now after I commit some code and close the vm. When I open the vm again git data is lost I get error loose data object is corrupt when I use git. This happens everytime please help.

2
  • 1
    How do you shut down the VM? Commented May 23, 2018 at 13:54
  • I close the command window.
    – gooey
    Commented May 23, 2018 at 15:25

1 Answer 1

0

You're not shutting down the VM. You're yanking the power cord out, so to speak. The results are the same as after power loss – if the OS didn't flush some modifications to the "disk", they're lost and the filesystem possibly corrupted.

Always use the guest OS's "shutdown" command, and wait for the VM to flush pending writes, shut down services, and eventually the window will close by itself.

Alternatively, use the Qemu monitor's system_powerdown command, which simulates a power button press and will make the VM start the regular shutdown process. (The Qemu monitor can be activated using -monitor stdio.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .