packages icon indicating copy to clipboard operation
packages copied to clipboard

hv-tools: add new package: hyper-v guest tools

Open NikulovE opened this issue 1 year ago • 15 comments

Maintainer: me Compile tested: (x86_64, OpenWrt SNAPSHOT r27084-16959ebf5f version) Run tested: (x86_64, OpenWrt SNAPSHOT r27084-16959ebf5f version)

Description: Main purpose of this new package is better integration with Hyper-V via hyper-v guest tools. Hyper-V guest tools are already in Linux kernel in /tools/hv but not included any OpenWRT builds. This PR is pack to bring it back. Other function is turned back VSS (shadow copy) integration. Also realized hv_set_ifconfig.sh that can be useful in cloud environment and other

Without this package: image after manual installation: image

NikulovE avatar Aug 23 '24 10:08 NikulovE

I see you already created three PRs for this package. There is a lack of commit description, which needs to be added. You need to use force push for it.

BKPepe avatar Aug 23 '24 11:08 BKPepe

I see you already created three PRs for this package. There is a lack of commit description, which needs to be added. You need to use force push for it.

Thank you for reply! It`s my first experience with PR, sorry if wrong somewhere. Following rules, I added commit that starts from package name: "hv-tools: Hyper-V Guest tools", I tested it on own environment and was wondered that it failed on self-checks in github actions. Each time, I tried to fine-tune my PRs that should be clear and without great history.

NikulovE avatar Aug 23 '24 11:08 NikulovE

compiled package is available at https://github.com/NikulovE/hv-tools/releases/tag/1.0.0

NikulovE avatar Aug 24 '24 07:08 NikulovE

Dear @BKPepe is it Ok now?

NikulovE avatar Aug 28 '24 11:08 NikulovE

What a stopper now?

NikulovE avatar Sep 05 '24 11:09 NikulovE

As I already told, this needs to be done differently to be upstreamable. You need to use Linux kernel source. We dont definetely what something what is forked and can be tinkered with, also your files could be outdated, so using Linux kernel tree here is the best choice here. I am quite sure that there is exists a Makefile in this repository, which you can use as an example instead of reinventing a wheel once again.

BKPepe avatar Sep 05 '24 11:09 BKPepe

@BKPepe I reworked Makefile, now it`s firstly download actual linux kernel for target and using these files for building

NikulovE avatar Feb 19 '25 11:02 NikulovE

I'm not sure a package with 3 GitHub stars is all the relevant for inclusion. And looking at the repo itself it looks like it's just a package definition again with some scripts? Why isn't it here instead?

GeorgeSapkin avatar Dec 10 '25 16:12 GeorgeSapkin

One of these stars is mine and I'd really like to have Hyper-V guest tools in the official OpenWrt package repo. Don't care too much how it's implemented, but having no guest tools for a major hypervisor at all is a bit of a bummer.

maurice-w avatar Dec 10 '25 17:12 maurice-w

One of these stars is mine and I'd really like to have Hyper-V guest tools in the official OpenWrt package repo. Don't care too much how it's implemented, but having no guest tools for a major hypervisor at all is a bit of a bummer.

Right. Microsoft added hyper-v guest source into linux kernel several years ago but OpenWrt should also add some interposer app layer to interact with kernel, but I don`t know how to implement this pull request correctly

NikulovE avatar Dec 10 '25 17:12 NikulovE

There's the qemu-ga package for QEMU VMs in utils/qemu. Maybe this could be a reference?

maurice-w avatar Dec 10 '25 17:12 maurice-w

Let me check again. Will do this exercise again, but a bit deeper

NikulovE avatar Dec 10 '25 17:12 NikulovE

Finished https://github.com/NikulovE/packages/actions/runs/20125821368/job/57755154208 let me prepare now correct PR with sign

NikulovE avatar Dec 11 '25 07:12 NikulovE

As I already told, this needs to be done differently to be upstreamable. You need to use Linux kernel source. We dont definetely what something what is forked and can be tinkered with, also your files could be outdated, so using Linux kernel tree here is the best choice here. I am quite sure that there is exists a Makefile in this repository, which you can use as an example instead of reinventing a wheel once again.

The current implementation does use the official Linux kernel source - it downloads required files directly from git.kernel.org/stable/linux.git using the $(LINUX_VERSION) variable from OpenWrt's build system. This ensures:

No fork - sources come from the official kernel.org stable tree Always in sync - version matches OpenWrt's kernel via $(LINUX_VERSION) Not outdated - files are fetched for the exact kernel version being built The initial approach ($(LINUX_DIR)/tools/hv) cannot work in OpenWrt SDK because SDK only contains minimal kernel headers, not the full source tree including tools/. The SDK CI build logs confirm this:

cp: cannot stat '/builder/build_dir/.../linux-6.12.60/tools/hv': No such file or directory Alternative approaches considered:

❌ Copy from $(LINUX_DIR)/tools/hv - doesn't exist in SDK ❌ Download full kernel tarball - too heavy (~150MB) for small tools ✅ Current: Download only needed files via wget - lightweight, version-matched

I checked usbip (which also uses kernel tools), but it has the same limitation in SDK.

If there's a better way to access kernel sources in SDK, I'm happy to implement it. Otherwise, the wget approach seems to be the only viable solution for SDK builds.

NikulovE avatar Dec 11 '25 08:12 NikulovE

I see you already created three PRs for this package. There is a lack of commit description, which needs to be added. You need to use force push for it.

Added description

NikulovE avatar Dec 11 '25 08:12 NikulovE