7. Given a cube with edge length 6, there is a regular tetrahedron with edge length $x$ inside it, and the tetrahedron can rotate freely within the cube. Then the maximum value of $x$ is $\qquad$ .
Thus, $A O=\frac{\sqrt{3}}{3} x$, the height of the regular tetrahedron is $\frac{\sqrt{6}}{3} x$.
Hence $\left(\frac{\sqrt{6}}{3} x-3\right)^{2}+\left(\frac{\sqrt{3}}{3} x\right)^{2}=3^{2}$
$\Rightarrow x=2 \sqrt{6}$.
$7.2 \sqrt{6}$.
It is easy to know that the radius of the inscribed sphere of the cube is 3. If the regular tetrahedron can rotate freely inside the cube, it only needs to be the inscribed regular tetrahedron of the cube's inscribed sphere, which indicates that the circumradius of the regular tetrahedron with edge length $x$ is 3.

Let the regular tetrahedron be $P A B C$, and draw $P O \perp$ plane $A B C$, with the foot of the perpendicular being $O$. Then $O$ is the center of $\triangle A B C$.