I'm writing a simple kernel character device driver, and I wonder how safe is it to do it on my own machine's OS instead of on a VM.
Could a kernel panic be destructive?
I had these issues when I started writing device drivers.
A real kernel developer doesn't mess around with VMs. Don't be afraid to test and code on real machine. I compiled a separate kernel exclusively for testing device drivers. I have one kernel for testing and another for application programming.
If you want to test drivers on a newly built kernel, this is a nice guide on installing a new kernel.