Responsibility/ethics of startups during graduate studies
Well, I did something like that, and I must say it eats up all your time. As said in one of the comments, it is only likely to succeed, if there is a close relation between thesis and company, otherwise you won't find enough time for both of them and fail.
If your thesis is closely related, you should inform your advisor very early in the process, because most advisors think all ideas emerging from their institution are their ideas or at least inspired by them. Despite of that, a good advisor could open some doors and be of help.

Legally, you might even be forced to do this (depending on the situationin your country), e.g. in Germany most contracts do not allow side business without anouncement to your employer. Of course, as long as it can be considered a hobby, noone can sue you for that.

You do a great job if the PhD-programm can sell it as a success story, because their funded project resulted in a new start-up.