Setting up Home Assistant in a virtual environment on Intel NUC (or any x86 machine)

Hey everybody,

i just finished a howto for a friend of mine!

Maybe this helps anybody else =)

Comments appreciated!

cvoid’s blog - setting up HA on a Intel NUC

10 Likes

Great Job! I’m sure it will be helpful to many! :+1:

1 Like

is there a reason you didn’t go the Docker route instead?

hass.io is with any discussion a great project. I like to see what happens “under the hood”.
Setting a up a virtual env allows you more to interact with diffrent components and is for me the better choice.
i.e. running git from the shell or backing things up with shell commands.

Very detailed set of instructions. You may want to re-title the thread to point to this set of instructions working on any x86 machine. I only skimmed your instructions but it seemed to mirror my server installation which is not on a NUC.

I agree…most of the instructions can be use on any x86 system.

Thanks, title updated.

Fair enough.

I am curious what things you do here that I cannot do with a Docker environment. I want to find my limitations in my current environment.

You can’t easily modify the HASS components if you wanted to (you’d have to Docker exec into the container and edit the files, which would be erased when the container is recreated) - I can see that being one motivation (ie trying a latest commit from GitHub on top of your current version install). I recently did this on .61 to modify the Wink component to get some functionality added in .62; so you can do it on Docker (which I am) but it’s not as easy or permanent as just navigating the directory structure on your system as you could installed in a venv.

2 Likes

right. which is not something I tend to do. ever. the thought never even crossed my mind to modify the components.

this makes that point clearer though. OK.

I thought you could dump a custom_components directory in your config and put the newer libraries and python apps and it would use them over the ones built into HA?

For me, I’ve got a number of local scripts and programs that I run for some of my automations and sensors. I could do it with Docker, but I’d end up with a container that was a basic Linux install to run it all in.

Then there’s the overhead that Docker brings. When you’re running on a Pi3, that overhead is non-trivial.

My $0.02 is:

  • Docker isn’t some magic solution, it just provides another option for building things. There are cases it’s clearly a good solution, some where it’s clearly a bad solution, and the majority where it’s just a solution.
  • If you ever think that there’s only one way of tackling a problem, then you’re missing something. Heck, Home Assistant supports 14 official different options on the install page.

I think it’s great that people like @void take the time to document what works for them, to help other people expand their knowledge and perspective.

1 Like

Out of interest, how do you run your supporting programs (eg mosquitto, nodered, appdaemon, etc)? I like Docker because I can run all of those things isolated from my OS.

I’m curious what scripts and programs you use. I feel like I’ve gotten to a point that I don’t know what else I can do to my Home Assistant environment and I’m always looking for ideas. I don’t have problems running the few scripts I have played with, in my docker instance.

Right. I get that, but the topic of this discussion is actually x86 based hardware which means we aren’t constrained by a pi.

Oh I know. I see weird stuff people try to do with Docker all the time and I wonder what on Earth would make them want to do such a thing. Lol. But in the case of home assistant, I feel like it’s the perfect method for me.

Yeah. I don’t believe my way is the best, only the best for me, but I see so many people going the route of a pyenv install, simply because they don’t understand Docker. I see very little reference on the forums to people running in docker. Since I believe it’s best for me, I wonder what I’m missing out on.

I apologise. I wasn’t trying to discredit anything or ignore the effort put into documentation. I was just curious. I appreciate all the documentation that anyone provides on home assistant.

For me this is one of the biggest positives for running docker. I don’t have to worry about dependencies. Ever. I don’t have to worry about another app causing my environment to crash. To me it’s a very cool way to modularize everything and make sure your home automation stack runs trouble free (as trouble free as possible. Lol).

I think @Tinkerer made everything clear :wink:

IMHO (!) the variety of options what to do in the future is better maintainable with any kind of “open” deployment.

In general I’m not a huge fan of “click and done” solutions. Expanding general knowledge (e.g. in running multifeatured server) could be fun for some people.

I can agree with that.

I guess as an IT guy for nearly 20 years, and considering I have a crazy complex network, servers, and have been managing Linux for a number of years, I don’t consider Docker as a “click and done” option. Understanding how Docker works kind of requires a level of knowledge that you only get by playing with systems like this.

Again, I apologise. I didn’t intend to derail anything or make it seem like I was discrediting your documentation and implementation efforts. I was merely curious why you would go that route, given the horsepower behind the NUC.

Obviously now @flamingm0e and I have to collaborate on an article about setting up HA and other programs in Docker. This is great @void and I totally commend your effort (with one exception… why Ubuntu 17.10?? Should be 16.04 :wink:)! These are the type of tutorials that we need around to point new users to in a “Read this first” type of post.

1 Like

also no offense. i would consider myself as an “interested user” never as an expert…
no doubt, your expertise in linux is much better than mine.

getting behind the complexity of docker is surely an achievable task and is on my list…

however tend a lot of people to critize me about all this (not in this thread) and ask “why not using xyz, this and that, your are done in a minute…”

maybe I’m a bit thin-skinned right now… sorry for that.

1 Like

i was considering the LTS version but i want to test out netplan (new in 17.10) and go with the latest stable python3 version from the sources…

and I know myself, I won’t run this installation for 5 years :wink:

Have a look at my GitHub for details of much of it. The biggest pain would probably be the email processing chain and associated sensors.

And that is the thing that many people miss, and your initial post missed - it’s about what works for individuals. Choice is good :smiley:

Please do! The more “to the point” guides for people to follow there are, the better informed people can be.

1 Like

Sorry, I didn’t intend for my initial comment to sound like I was thinking there was only one correct way. I wanted to know the MOTIVATION to go the route of the python venv rather than the docker way…I haven’t seen anything yet that would compel me to go that route, so I only sort of understand why one would select that way (based on some edge cases pointed out to me).