Having issues getting X running with Hyper-V* reddit / freebsd ---------------------------------------------------------------------- MetalPlateMage · 2023-03-31 00:04 UPDATE: I got it working - see my update (in a comment I made, not this OP) below! Hi all. I'm trying to get something in X11 up and running for cross- platform development going with CMake remote with VStudio. Last year I was able to get KDE up and running easily with no issues, but I had to move to a new machine and do it over again this year. Anyways... I installed FreeBSD from the VHD first (https://download.freebsd.org/releases/VM- IMAGES/13.1-RELEASE/amd64/Latest/) using the KDE guide (https://community.kde.org/FreeBSD/Setup) and that seemed to be going ok until the very end when it starts sddm. When sddm stats up there are no error messages of any kind, but the screen takes a quick black flash from top to bottom (split second) then the machine is completely bricked. Ctrl+C, Ctrl+Alt+F1, none of the usual combos work. That's where the asterisk comes in, because you see I can get X11 running perfectly... but in a Gen2 VM... where FreeBSD has no mouse drivers. The problems happen in the Gen1 VM. It's rather odd because usually Gen1 is trouble-free. Since I noticed mouse integration wasn't working perfectly with the VHD release in the console, I reinstalled everything from scratch with the ISO release. That got mouse integration working (in the Gen1 VM since Gen2 has no mouse drivers with FreeBSD again), but the same exact problem happened with sddm. Again, Gen2 worked with the ISO release in the exact same fashion, but no mouse. So at that point I gave up on KDE thinking it was the problem, and tried xfce (guide: https://www.quentb.com/posts/freebsd-hyperv- tutorial/). However, the same problem happened, only just with startx or any variation thereof. On my machine I run a I9-13900K with a GTX 3080TI with 64GB DDR5. Maybe someone has a clue, or maybe there's some other additional info I can give? Willing to try anything. Should mention I tried using the nvidia drivers from pkg but that didn't seem to make a difference, and from what I can remember video acceleration doesn't work in Gen1 VMs anyway or similar. ---------------------------------------------------------------------- nmariusp · 2023-03-31 07:39 Maybe you should not use the VM image and just install everything from the iso file such as https://www.youtube.com/watch?v=hkVxKVaBnT4 ? > using the KDE guide (https://community.kde.org/FreeBSD/Setup) I vote that THE place for instructions on how to install KDE is the Handbook. https://community.kde.org/index.php?title=FreeBSD/Setup&action=history ---------------------------------------------------------------------- yuripv79 · 2023-03-31 17:37 The driver for Gen2 mouse for X is there in -CURRENT, and I completely forgot about MFC, so it will not be there in 13.2 sadly (will try to get into 13-STABLE shortly). In the meantime, I can provide you a patch for 13.1-RELEASE if you are up to rebuilding the kernel. ---------------------------------------------------------------------- yuripv79 · 2023-03-31 19:56 Should now be in stable/13. ---------------------------------------------------------------------- [deleted] · 2023-04-01 14:57 [deleted] ---------------------------------------------------------------------- [deleted] · 2023-04-01 15:03 [deleted] ---------------------------------------------------------------------- MetalPlateMage · 2023-04-03 00:29 FINALLY! I got it working (with a Gen2 VM no less)! Thanks yuri. It took a lot of work. So in the future if anyone is embarking on this task: 1. Recompile the kernel. First I had to figure out how to get the original git copy - I think the command was "git clone -b stable/13 URL"... I forgot the url I used to get the right git link. It wasn't in the handbook strangely - it just said to pull /usr/src which doesn't get the right branch or something for me. I had some issues in addition to that (besides finding the right git command to get the right source) in that the wrong source in /usr/src and that directory did not want to be deleted. It took me a full reboot to kill that directory for a clean checkout. Then the handbook picks off after there: [Chapter 25. Updating and Upgrading FreeBSD | FreeBSD Documentation Portal](https://docs.freebsd.org/en/books/handbook/cutting- edge/#makeworld) It takes a couple-few hours to fully compile even on high end hardware. 2) This will get you working mouse support in X with a Gen2 VM. I should note that when you aren't in X there will still be a mouse pointer in the middle of the screen that you can't control, but it will work with X. HOWEVER recompiling the kernel broke sddm for me and it spit it out endless errors like: [https://i.imgur.com/KEQBh6K.png](https://i.imgur.com/KEQBh6K.png) 3) So I stumbled across this which actually worked! [\[Solved\] How to start KDE using .xinitrc in arch installed on hyper-v? / Applications & Desktop Environments / Arch Linux Forums](https://bbs.archlinux.org/viewtopic.php?id=266390) The short version is that you modify /usr/local/etc/X11/initrc, comment out the lines with twm at the end, and stick export DESKTOP_SESSION=plasma exec startplasma-x11 at the end. After that KDE and everything worked perfectly\* with startx! \* well, not 100% - KDE thinks my username is "&" for some reason \*shrug\*, but everything works even including youtube videos in konqueror. So there you go! ---------------------------------------------------------------------- yuripv79 · 2023-04-03 10:05 With mouse issue sorted out, and if you are feeling really adventurous, I have a WIP of a bit better Hyper-V framebuffer handling in https://reviews.freebsd.org/D39395. It should allow you to set a resolution bigger than default 1024x768, see the command (the PowerShell one) in the review. To try it, download the diff, apply using `git apply ~/patch/to/diff` (the diff is against main, but should apply to stable/13 as well as it only adds the files), build/install from the module directory (`cd /usr/src/sys/modules/hyperv/fb; make; make install`) and load using `kldload hv_fb.ko`. Warning: please note that it's really experimental, unloading will not restore the console, you'll have to reboot VM. ---------------------------------------------------------------------- MetalPlateMage · 2023-04-03 15:28 The installation went without a hitch, and when I start it up via hldload hv_fb.ko: https://i.imgur.com/0lf0aVs.png KDE is still complaining, as you mention that may not be supported yet: https://i.imgur.com/cLEOdLQ.png It still thinks that base resolution is the only supported sadly. However setting it via powershell works: https://i.imgur.com/WRU1Wa0.png The bigger resolution is really nice thanks! From the list it seems like it caps out at 1920x1080 currently if I'm reading it right. Would be nice to solve the pointer-in-the-middle-of-the-screen when not in X as well. I'm really happy with all this though. If there's anything else you want me to test I'd be happy to! EDIT: Nice big picture of desktop in 1920x1080 with KDE saying 1920x1080 is the only supported now: https://i.imgur.com/BKsFpf1.png ---------------------------------------------------------------------- grahamperrin · 2023-04-09 13:09 > UPDATE: I got it working … If you like, mark your post: [answered](https://i.imgur.com/pTA9UeG.png)